---
title: "Self-host an Atuin sync server"
description: "Run your own Atuin sync server on an always-on exe.dev VM, so shell history and Atuin Threads agent sessions follow you to every laptop and VM."
url: https://exe.dev/deploy/atuin
category: "Developer tools"
updated: 2026-11-13
---

# Self-host an Atuin sync server

Shell history and agent sessions that follow you to every VM.

- **Software:** Atuin (https://atuin.sh)
- **Source:** https://github.com/atuinsh/atuin
- **License:** MIT
- **Time:** 10 minutes
- **Example VM name:** `my-atuin` (yours will differ; on the VM, `hostname` prints it)
- **Machine-readable:** https://exe.dev/deploy/atuin/manifest.json
- **File:** https://exe.dev/deploy/atuin/join.sh

## What you get

- atuin-server 18.24.8 on port 8000 with SQLite in `~/atuin-server`, started again after a reboot
- Registration closed, and one account, `me`, with a random password in `~/atuin-server/password`
- A login to that account that succeeds through the server's API
- A nightly SQLite backup in `~/atuin-server/backups`

Running on the VM:

- **atuin-server**: atuin-server 18.24.8, the official binary, managed by systemd, port 8000, data in `~/atuin-server`
- **SQLite**: end-to-end encrypted records; the server can't read them, data in `~/atuin-server/atuin.db`
- **Nightly backup**: a systemd timer that keeps a week of SQLite copies, data in `~/atuin-server/backups`

How it is reached:

- https://my-atuin.exe.xyz/ (public): the sync API; only your account can log in, and records arrive already encrypted

## Deploy with Shelley

Open https://exe.dev/new?prompt=Set%20up%20Atuin%20on%20this%20VM%20by%20following%20the%20exe.dev%20recipe%20at%20https%3A%2F%2Fexe.dev%2Fdeploy%2Fatuin.md%20from%20top%20to%20bottom.%0A%0AThe%20recipe%27s%20example%20VM%20name%20is%20my-atuin.%20This%20VM%27s%20name%20is%20the%20output%20of%20%60hostname%60%3A%20use%20it%20wherever%20the%20recipe%20writes%20my-atuin.%20Skip%20the%20step%20that%20creates%20the%20VM%3B%20you%20are%20on%20it.%0A%0AYou%20are%20done%20when%20all%20of%20these%20are%20true.%20Check%20each%20one%20yourself%3A%0A-%20atuin-server%2018.24.8%20on%20port%208000%20with%20SQLite%20in%20%60~%2Fatuin-server%60%2C%20started%20again%20after%20a%20reboot%0A-%20Registration%20closed%2C%20and%20one%20account%2C%20%60me%60%2C%20with%20a%20random%20password%20in%20%60~%2Fatuin-server%2Fpassword%60%0A-%20A%20login%20to%20that%20account%20that%20succeeds%20through%20the%20server%27s%20API%0A-%20A%20nightly%20SQLite%20backup%20in%20%60~%2Fatuin-server%2Fbackups%60%0A%0ARun%20the%20VM-side%20steps%20of%20%22Set%20up%20the%20server%22%20and%20%22Back%20up%20and%20restore%22%0A%28the%20timer%20only%29%2C%20skipping%20VM%20creation.%20Install%20exactly%20the%20pinned%0Aversion.%20If%20%60~%2Fatuin-server%60%20already%20has%20a%20database%2C%20keep%20it%20and%20don%27t%0Acreate%20the%20account%20again.%20Never%20print%20the%20password%3A%20say%20where%20it%20is.%0AVerify%20with%20the%20checks%20in%20those%20sections.%20You%20can%27t%20make%20the%20VM%20public%3B%0Afinish%20by%20telling%20the%20owner%20to%20run%20%60ssh%20exe.dev%20share%20set-public%20%3Cvm%3E%60%0Aon%20their%20computer%20and%20then%20follow%20%22Connect%20your%20computer%22%20and%20%22Join%0Aevery%20new%20VM%22.%20Don%27t%20install%20the%20Atuin%20client%20on%20this%20VM.%0A%0AFinish%20with%20the%20URLs%20I%20should%20open%20and%20these%20commands%2C%20which%20only%20I%20can%20run%2C%20from%20my%20own%20computer%20%28with%20this%20VM%27s%20name%20in%20them%29%3A%0A%20%20ssh%20exe.dev%20share%20set-public%20my-atuin%0A to create a VM whose agent, Shelley, follows this recipe. From a terminal:

```sh
curl -fsSL https://exe.dev/deploy/atuin/prompt.txt | ssh exe.dev new --prompt=/dev/stdin
```

Then, on your own computer:

```sh
ssh exe.dev share set-public my-atuin
```

Or follow the steps below by hand.

[Atuin](https://atuin.sh) replaces your shell history with a searchable,
synced database, and since version 18.24 it does the same for coding
agents. [Atuin Threads](https://blog.atuin.sh/threads-agent-sessions/)
records your Claude Code, Codex, Pi, OpenCode and other agent sessions,
end-to-end encrypted, and `atuin resume` picks one up on any machine, in
the same agent or a different one. Atuin's author lists where her sessions
were scattered before, including "ephemeral instances on exe.dev".

Sync needs a server that is always there. This recipe runs Atuin's own
sync server on one small exe.dev VM, with its data on the VM's persistent
disk. Your laptop and every other VM sync through it: start a task in
Claude Code on a throwaway VM, delete the VM, and resume the session from
your laptop or the next VM.

## Set up the server

On your computer, create the VM and connect. Pick any free name:

```bash
ssh exe.dev new --name=my-atuin
ssh my-atuin.exe.xyz
```

On the VM, install the server with Atuin's installer for this release. It
puts `atuin-server` in `~/.atuin/bin`:

```bash
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/atuinsh/atuin/releases/download/v18.24.8/atuin-server-installer.sh | sh
```

Configure it to listen on port 8000, where exe.dev's
[HTTPS proxy](/docs/proxy) sends `https://my-atuin.exe.xyz/`, with SQLite
for storage and registration closed. Run it under systemd:

```bash
mkdir -p ~/atuin-server && chmod 700 ~/atuin-server
cat > ~/atuin-server/server.toml <<EOF
host = "0.0.0.0"
port = 8000
open_registration = false
db_uri = "sqlite://$HOME/atuin-server/atuin.db"
EOF
sudo tee /etc/systemd/system/atuin-server.service >/dev/null <<EOF
[Unit]
Description=Atuin sync server
After=network-online.target
Wants=network-online.target

[Service]
User=$USER
Environment=ATUIN_CONFIG_DIR=$HOME/atuin-server
ExecStart=$HOME/.atuin/bin/atuin-server start
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now atuin-server
until curl -sf localhost:8000/ >/dev/null; do sleep 1; done
```

Once it answers, create your account, `me`, with a random password. The email is only
stored; the server sends no mail:

```bash
(umask 077; openssl rand -base64 24 | tr -d '/+=' > ~/atuin-server/password)
ATUIN_CONFIG_DIR=~/atuin-server ~/.atuin/bin/atuin-server admin user create \
  --email me@example.com me < ~/atuin-server/password
```

Check it. The server answers with its version, refuses to register
anyone, and logs `me` in (the answer has a `session`):

```bash
curl -s -w '\n' localhost:8000/
curl -s -w '\n' localhost:8000/register -H 'Content-Type: application/json' \
  -d '{"username":"x","email":"x@example.com","password":"xxxxxxxx"}'
jq -n --arg p "$(cat ~/atuin-server/password)" '{username:"me",password:$p}' |
  curl -s localhost:8000/login -H 'Content-Type: application/json' -d @- | jq keys
```

```
{"homage":"\"Through the fathomless deeps of space swims the star turtle Great A'Tuin, ...","version":"18.24.8"}
{"reason":"this server is not open for registrations"}
[
  "auth",
  "session"
]
```

## Make it reachable

The Atuin client talks HTTPS to its server from your terminal, so it can't
sign in to exe.dev the way a browser does. Make the server public. On your
computer:

```bash
ssh exe.dev share set-public my-atuin
curl -s https://my-atuin.exe.xyz/
```

This is the setup Atuin is built for, the same as its hosted server:
everything is encrypted on your machines before it is sent, nobody can
register, and the one account has a long random password. To keep the
server off the internet instead, see the FAQ on Tailscale.

## Connect your computer

Your computer is the first machine, and its encryption key becomes the
account's key. Install Atuin on it if you haven't, pointed at your server
(it asks a few questions about key bindings and importing history):

```bash
curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh -s -- --sync https://my-atuin.exe.xyz
```

If Atuin was already installed and syncing elsewhere, run `atuin logout`
and then `atuin config set sync_address https://my-atuin.exe.xyz` instead.

Log in with this machine's key, so the history you have stays readable,
and sync. The password is the one on the server; `-p -` reads it from
standard input:

```bash
ssh my-atuin.exe.xyz cat atuin-server/password | atuin login -u me -p - -k "$(atuin key)"
atuin sync
atuin status
```

`atuin status` shows `Address: https://my-atuin.exe.xyz/` and
`Username: me`. If the installer turned Threads on (it asks), your agents'
sessions on this computer are captured from now on; `atuin threads import`
adds the ones from before.

## Join every new VM

A new VM needs Atuin, the server's address, the password and your key.
[join.sh](https://exe.dev/deploy/atuin/join.sh) does that, and first
connects Claude Code and Codex to exe.dev's
[LLM integration](/docs/integrations-llm), so a session resumed there runs
with no API key. On your computer, put it together with your credentials
in one file only you can read:

```bash
mkdir -p ~/.config/atuin-exe
(umask 077; {
  echo '#!/bin/bash'
  echo 'export ATUIN_SYNC=https://my-atuin.exe.xyz ATUIN_USERNAME=me'
  echo "export ATUIN_PASSWORD='$(ssh my-atuin.exe.xyz cat atuin-server/password)'"
  echo "export ATUIN_ENCRYPTION_KEY='$(atuin key)'"
  curl -fsSL https://exe.dev/deploy/atuin/join.sh
} > ~/.config/atuin-exe/setup.sh)
```

Make a VM with it as the [setup script](/docs/customization#setup-scripts),
which runs once at first boot (and is deleted from the VM afterwards):

```bash
ssh exe.dev new --setup-script /dev/stdin < ~/.config/atuin-exe/setup.sh
```

To join every VM you create from now on, make it your default setup
script. exe.dev then stores your password and key with your account
settings, so use this only if you're comfortable with that:

```bash
ssh exe.dev defaults write dev.exe new.setup-script < ~/.config/atuin-exe/setup.sh
```

A VM you already have joins the same way, by running the file on it:

```bash
ssh other-vm.exe.xyz bash < ~/.config/atuin-exe/setup.sh
```

On a joined VM, `atuin status` names your server, and `atuin threads list`
shows the sessions from your other machines.

## Resume a session somewhere else

On a joined VM, start Claude Code in a project and give it some work.
Atuin's daemon records the session as it goes and syncs it every few
minutes; `atuin sync` sends it now.

Then, on your computer or another joined VM:

```bash
atuin sync
atuin resume
```

The picker lists every session, with the machine it ran on. Enter twice
resumes it in its own agent: Atuin writes the transcript out from the
synced records first. The list under it offers the other agents installed
here, which continue the same conversation as a new session. From a
script, name the session (an id prefix is enough) and the agent:

```bash
atuin threads list
atuin resume b3d629a2 --in codex
```

Agents can search old sessions too. `atuin setup` adds Atuin's MCP server
to Claude Code and Codex when they're installed (`atuin mcp install
<agent>` adds it later), so a new session can find how an earlier one
solved something.

## Back up and restore

The server's data is `~/atuin-server/atuin.db`, already encrypted with
your key. Every logged-in machine also keeps its own full copy, so a
lost server is a nuisance rather than a loss; your key (`atuin key`) is
what you must never lose. Keep a week of nightly copies on the VM:

```bash
mkdir -p ~/atuin-server/backups
sudo tee /etc/systemd/system/atuin-backup.service >/dev/null <<EOF
[Service]
Type=oneshot
User=$USER
ExecStart=/bin/sh -c 'sqlite3 $HOME/atuin-server/atuin.db ".backup $HOME/atuin-server/backups/atuin-\$(date +%%F).db" && find $HOME/atuin-server/backups -name "atuin-*.db" -mtime +7 -delete'
EOF
sudo tee /etc/systemd/system/atuin-backup.timer >/dev/null <<EOF
[Timer]
OnCalendar=daily
Persistent=true

[Install]
WantedBy=timers.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now atuin-backup.timer
sudo systemctl start atuin-backup.service
ls ~/atuin-server/backups
```

To keep one off the VM, copy it to your computer:
`scp my-atuin.exe.xyz:atuin-server/backups/atuin-$(date +%F).db .`

To restore, stop the server, put a copy in place, and start it:

```bash
sudo systemctl stop atuin-server
rm -f ~/atuin-server/atuin.db-wal ~/atuin-server/atuin.db-shm
cp ~/atuin-server/backups/atuin-YYYY-MM-DD.db ~/atuin-server/atuin.db
sudo systemctl start atuin-server
```

## Update

Read the [release notes](https://github.com/atuinsh/atuin/releases) first:
Atuin asks self-hosters to follow tagged releases. Then install the new
version's server and restart it:

```bash
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/atuinsh/atuin/releases/download/vX.Y.Z/atuin-server-installer.sh | sh
sudo systemctl restart atuin-server
curl -s -w '\n' localhost:8000/
```

Clients update themselves with `atuin update`, or by running the install
command again.

## Troubleshooting

- **The server doesn't start.** `journalctl -u atuin-server -n 50` shows
  why; a typo in `~/atuin-server/server.toml` is the usual cause.
- **`error sending request` on login.** The VM isn't public yet
  (`ssh exe.dev share show my-atuin`), or you're on the server VM itself,
  which can't reach its own public address: use `http://localhost:8000`
  there.
- **A session doesn't show up on another machine.** Run `atuin sync` on
  both. If `atuin threads list` is still empty, check that capture is on
  (`atuin config get threads.capture`) and the daemon is running
  (`atuin daemon status`); `atuin threads enable` turns both on.
- **Login fails with a key error.** Every machine must use the same key.
  Run `atuin key` on a machine that syncs, and log in with `-k` and those
  words.
- **Forgot the password.** On the server,
  `ATUIN_CONFIG_DIR=~/atuin-server ~/.atuin/bin/atuin-server admin user set-password me`
  sets a new one; machines that are logged in stay logged in.

## Frequently asked questions

### Why self-host instead of using Atuin's hosted sync?

Atuin's hosted server is end-to-end encrypted too, so either works. Self-hosting keeps even the encrypted records, and the record of when your machines sync, on a machine you control. It is also the only option if your company doesn't allow a third-party sync service.

### Is it safe to make the server public?

It is how Atuin is designed to run, and how its hosted server runs. Records are encrypted with your key before they leave a machine, so the server only stores ciphertext. Registration is closed, and the only account has a long random password. What an attacker can reach is Atuin's login and sync API, over HTTPS from exe.dev's proxy.

### Can I keep the server off the internet?

Yes, with Tailscale: leave the VM private, put it and every client on your tailnet (the [Tailscale integration](/docs/integrations-tailscale-wif) joins VMs without keys), and use `http://my-atuin:8000` as the sync address. The price is that each new VM must join the tailnet before it can sync. exe.dev's own login can't sit in front: it is made for browsers, and the Atuin client can't sign in to it.

### Which agents does Atuin Threads capture?

Claude Code, Codex, Copilot, Grok Build, Hermes Agent, Kiro, opencode, Pi and Amp, according to [Atuin's docs](https://docs.atuin.sh/latest/ai/threads/). Capture is on after `atuin setup`, and the Atuin daemon records sessions as the agents write them. `atuin threads import` brings in older ones.

### Can a session move to a different agent?

Yes. In the `atuin resume` picker, pick another installed agent, or run `atuin resume <id> --in codex`. The conversation and its tool calls carry over into a new session of that agent.

### Should I use PostgreSQL?

Not for one person: SQLite is one of Atuin's two first-tier databases, and it needs nothing else running. For a server shared by a team, Atuin also supports PostgreSQL; set `db_uri` to a [PostgreSQL on exe.dev](/deploy/postgres) database.

### What does it cost?

Atuin is free and open source (MIT). The server is small: it runs next to anything else on a VM in your exe.dev plan. Agents you resume on a VM through exe.dev's [LLM integration](/docs/integrations-llm) are billed to your exe.dev account.


## Related

- [Run Claude Code on a remote server](https://exe.dev/deploy/claude-code.md): A computer for Claude. A breather for your laptop.
- [Run Codex on a remote server](https://exe.dev/deploy/codex.md): A computer for Codex. An early night for your laptop.
- [Run the Pi coding agent on a remote server](https://exe.dev/deploy/pi.md): An agent that doesn't ask first, on a computer that can take it.
- [Run OpenCode on a remote server](https://exe.dev/deploy/opencode.md): Every model, one VM, and an agent that works while your laptop sleeps.
- [Self-host Hermes Agent](https://exe.dev/deploy/hermes-agent.md): An agent that remembers you, on a computer that never sleeps.
- [Self-host PostgreSQL](https://exe.dev/deploy/postgres.md): Your own Postgres on a real disk, with backups you've actually restored.
