Skip to content

Set Up Atuin on a Linux Server – Your Own Sync Server for Shell History

Set up the Atuin sync server as a One-Click App or with Docker on your VPS, and use your shell history across all your computers with end-to-end encryption.

1 December 202613 min read1 Views0 helpful

Introduction

Atuin replaces your shell’s standard command history with a searchable database. For every command, Atuin stores the time, directory, computer, duration, and exit code. Use Ctrl+R or the up arrow to search everything you’ve ever entered. Atuin works with bash, zsh, fish, Nushell, xonsh, and PowerShell.

Atuin gets especially useful when you work on multiple computers: a sync server synchronizes the history across all your devices using end-to-end encryption. You can then find a command you typed on your laptop last week on your server or work computer, too. You can run this sync server yourself instead of using the Atuin developers’ cloud service.

This guide shows you how to set up the Atuin sync server on your VPS: as a One-Click App or manually with Docker Compose. After that, you’ll connect your computers to the server and learn the most important commands.

Info: Atuin doesn’t have a web interface

The sync server is purely an interface for the atuin command-line program. If you open its address in a browser, you’ll only see a short line of text with the version number. That’s expected: you do everything else in the terminal.

When it makes sense to run Atuin on a VPS

Running your own Atuin server is worthwhile if:

  • You work on multiple computers and servers and want the same command history everywhere.
  • You don’t want your history stored with a third-party service. Commands often contain hostnames, paths, and parameters for internal systems. Running your own server means even the encrypted data stays with you.
  • You want to back up your history. Even with just one computer, the server acts as a backup: after a fresh installation, sign in and restore your entire history.
  • You already run a VPS. The sync server needs only a few megabytes of memory and runs well alongside other services.

Running your own server is less suitable if you use Atuin on only one computer and don’t need a backup. Atuin also works without a sync server, in which case your history stays local.

Your own server or Atuin Cloud?

The Atuin developers offer their own sync service, Atuin Cloud. Here’s how the options compare:

Your own serverAtuin CloudNo sync
Where is the data stored?On your VPSWith the Atuin developersOnly on the respective computer
EncryptionEnd-to-endEnd-to-endNo transfer
Sync between computersYesYesNo
MaintenanceYou handle updates and backupsHandled by the providerNone

In both sync options, your commands are encrypted before they leave your computer. With your own server, you also decide where the data is stored, who can create accounts, and how long backups are kept.

The easy way: Atuin as a One-Click App

The quickest way to get your own Atuin server is through your VPS’s One-Click Apps. With a domain, it’s immediately available over HTTPS. The One-Click App sets up the database, reverse proxy, and certificate for you.

Requirements

  • A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. See Set Up One-Click Apps for instructions.
  • Atuin needs 1 vCore and at least 256 MB of memory; 512 MB is recommended. The history takes up little space: 1 GB of storage is enough to get started, and 10 GB is generous.
  • The atuin program on every computer whose history you want to sync (see below).

Install

  1. Open your VPS in the ZapX dashboard and switch to the One-Click Apps tab.
  2. Search for Atuin in the App catalog and click Install app.
  3. Use a custom subdomain or zap.cloud is already selected. Leave this option enabled and enter a name, for example atuin. Without a domain, Atuin would only be available over HTTP, and your password would be transmitted unencrypted when you sign in.
  4. You don’t need to fill in anything under App configuration. The only field, ATUIN_OPEN_REGISTRATION, is optional and is set to true so you can create your account right away. ZapX generates the database username and password for you.
  5. Click Queue installation. After a few minutes, the app card will show Online.

The One-Click App starts two containers: atuin with the sync server and db with a PostgreSQL database. The database is only accessible within the app, while the sync server is only accessible through your domain. You can find the address on the app card under Access link, for example https://atuin-1234.zap.cloud.

Create an account and connect your first computer

Install Atuin on your computer. On Linux and macOS, you can do this with the official installation script. Replace atuin.example.com with the address shown under Access link:

Code
curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh -s -- --sync https://atuin.example.com

The script puts the program in ~/.atuin/bin, integrates Atuin with your shell, and passes --sync to the setup process. This adds the address of your own server to the ~/.atuin/config.toml file, so you don’t need an Atuin Cloud account. Answer the remaining setup questions, such as whether the up arrow should open search, as you prefer. Then open a new terminal.

If Atuin is already installed, or if you use Windows (install it with winget install -e Atuinsh.Atuin, then run atuin setup in a new terminal), enter the address like this:

Code
atuin setup --only --sync https://atuin.example.com

Then create your account and upload your history for the first time:

Code
atuin register -u USERNAME -e user@example.com
atuin sync
  • atuin register asks for a password and creates the account on your server. Atuin also generates a key to encrypt your history.
  • atuin sync uploads your history for the first time. After that, Atuin syncs automatically in the background, every five minutes by default.

Use atuin status to check that everything is working: under [Remote], you’ll see your server’s address and your username.

Warning: Keep your key safe

Display your key with atuin key and save it in your password manager. You’ll need it to sign in on other computers. If you lose it, nobody—not even you—can decrypt your history again.

Close registration

As long as ATUIN_OPEN_REGISTRATION is set to true, anyone who knows your server’s address can create an account on it. Other users can’t read your history because each entry is encrypted with the key for its respective account. However, they could use your server as free storage and fill it with data.

One account is enough for all your computers. Sign in on additional devices with atuin login; registration doesn’t need to be open for this. So close registration as soon as your account exists:

  1. Open the app settings (gear icon), then App environment.
  2. Under App configuration, set the ATUIN_OPEN_REGISTRATION field to false.
  3. Click Save. The app will restart with the new value and should be available again in about a minute.

Check the result by trying to register, for example by running atuin register -u test -e test@example.com on a computer that isn’t signed in yet. The server will now reject the attempt with 400 Bad Request - this server is not open for registrations. Your signed-in computers will continue to sync. If you need another account later, for example for a second person, briefly set the value to true, then set it back to false.

Updates and backups

To check for a new version, open the app settings (gear icon), go to App update, and click Check for updates. Install a new version by clicking Apply update. Your accounts and history will be retained; Atuin updates the database itself when it starts.

All accounts and encrypted history are stored in the PostgreSQL database in the atuin-db-data volume. A backup of your VPS under Backups will save everything. You can find the database password under App environment > Automatically generated values; you don’t need it for everyday use. In addition, every signed-in computer has a complete copy of its history.

Manual installation

The rest of this guide covers the manual installation of the Atuin sync server with Docker Compose. This is useful, for example, if you don’t use One-Click Apps on your server or want to run Atuin behind your own reverse proxy. The instructions are based on the official self-hosting guide.

Requirements

  • A Linux VPS running Debian or Ubuntu, with SSH access. See First Access via SSH.
  • Docker and Docker Compose. See Install Docker. Check the installation with docker --version and docker compose version.
  • A domain or subdomain whose A record points to your VPS’s IP address (e.g., atuin.example.com). Without HTTPS, passwords would be transmitted in plain text.
MinimumRecommended
CPU1 vCore1 vCore
RAM256 MB512 MB
Storage1 GB10 GB

The sync server itself needs only a few megabytes of memory while running; the database uses most of the resources.

Prepare the firewall

Atuin listens on port 8888. Don’t open this port; the server should only be accessible through a reverse proxy with HTTPS. With ufw, allow only SSH and the reverse proxy ports:

Code
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status

In the Compose file below, port 8888 is bound only to 127.0.0.1. This way, only the reverse proxy on the same server can reach it, even if Docker sets its own firewall rules. Learn more about firewall rules in Open Ports and Manage the Firewall.

Install with Docker Compose

Create a folder for Atuin, generate a random database password, and prepare the configuration folder. The server runs in the container as a user with ID 1000:

Code
mkdir -p ~/atuin/config && cd ~/atuin
echo "ATUIN_DB_PASSWORD=$(openssl rand -hex 24)" > .env
chmod 600 .env
sudo chown 1000:1000 config

Then create a compose.yaml file in the ~/atuin folder, for example with nano compose.yaml:

Code
services:
  atuin:
    image: ghcr.io/atuinsh/atuin:18.25.1
    command: start
    restart: unless-stopped
    ports:
      - "127.0.0.1:8888:8888"
    environment:
      ATUIN_HOST: "0.0.0.0"
      ATUIN_OPEN_REGISTRATION: "false"
      ATUIN_DB_URI: postgres://atuin:${ATUIN_DB_PASSWORD}@db/atuin
    volumes:
      - ./config:/config
    depends_on:
      - db

  db:
    image: postgres:18-alpine
    restart: unless-stopped
    environment:
      POSTGRES_USER: atuin
      POSTGRES_PASSWORD: ${ATUIN_DB_PASSWORD}
      POSTGRES_DB: atuin
    volumes:
      - ./database:/var/lib/postgresql

The important lines:

  • image uses the official image with a fixed version number. The developers explicitly advise against using latest or main. Find the current version in the Atuin releases.
  • command: start starts the sync server.
  • ports binds Atuin only to 127.0.0.1. The port isn’t accessible from outside.
  • ATUIN_HOST makes the server listen on all addresses in the container; otherwise, Docker couldn’t reach it either.
  • ATUIN_OPEN_REGISTRATION: "false" keeps registration closed. You’ll create your account directly on the server in a moment.
  • ATUIN_DB_URI connects Atuin to the database. The password comes from the .env file.
  • ./database contains the database with all accounts and encrypted history. PostgreSQL 18 expects the volume at /var/lib/postgresql, not /var/lib/postgresql/data anymore.

Start Atuin and check whether the server responds:

Code
docker compose up -d
docker compose ps
curl http://127.0.0.1:8888/

After a few seconds, docker compose ps should show the atuin container as healthy. curl returns a short line of text in JSON format with the version number.

Create your first account

Since registration is closed, create your account directly on the server. Replace USERNAME and the email address; the command will then ask for your password:

Code
docker compose exec atuin atuin-server admin user create --email user@example.com USERNAME

The username can contain letters, numbers, and hyphens. You can use the same method later to reset a forgotten password (admin user set-password USERNAME) or delete an account and its history (admin user delete USERNAME).

If you want to leave registration open, for example for a team, set ATUIN_OPEN_REGISTRATION to "true" and restart with docker compose up -d. However, anyone who knows the address will then be able to create an account and use your server’s storage.

Access over HTTPS through a reverse proxy

Set up nginx as a reverse proxy as described in Set Up an nginx Reverse Proxy, and obtain a certificate as explained in SSL Certificate with Let’s Encrypt. The server block for Atuin looks like this:

Code
server {
    listen 80;
    server_name atuin.example.com;

    client_max_body_size 50m;

    location / {
        proxy_pass         http://127.0.0.1:8888;
        proxy_set_header   Host $host;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
    }
}

client_max_body_size raises nginx’s limit (1 MB per request) so that the first sync of a large history doesn’t fail. Then run sudo nginx -t and sudo systemctl reload nginx, and obtain the certificate with sudo certbot --nginx -d atuin.example.com.

Install Atuin on your computers as described above for the One-Click App. Since your account already exists, sign in with atuin login instead of atuin register; see “Sign in on additional computers” below. If the first computer doesn’t have a key yet, Atuin will generate one: display it with atuin key, enter it when signing in, and keep it safe.

Back up your data

Accounts and history are stored in the PostgreSQL database. The easiest way to back them up is to export the database; the server can keep running:

Code
cd ~/atuin
docker compose exec -T db pg_dump -U atuin atuin > atuin-backup-$(date +%F).sql

Copy the file along with compose.yaml and .env to another computer or storage location. The history in the export is encrypted, but usernames and email addresses are readable. The official Docker guide explains how to create the export automatically on a regular schedule.

Update Atuin

Create a backup first and read the release notes. Then enter the new version number for image in compose.yaml and run:

Code
cd ~/atuin
docker compose pull
docker compose up -d
docker image prune -f

When it starts, Atuin updates the database itself to the new version. Also keep the atuin program on your computers up to date, for example with atuin update if you installed it using the installation script.

Connect additional computers and use Atuin

From this point on, it doesn’t matter whether your server runs as a One-Click App or was installed manually. The commands are the same on all computers.

Sign in on additional computers

Install Atuin on the next computer as described above, using your server’s address with --sync. If Atuin is already installed there, add the address with atuin setup --only --sync https://atuin.example.com. Then sign in with your existing account:

Code
atuin login -u USERNAME
atuin sync

atuin login asks for your password and key. You can display the key with atuin key on a computer that’s already signed in. After atuin sync, the history from all your devices will also be available on the new computer. This works on servers, too, so you can access your commands on every system you work on.

Search your history

  • Ctrl+R opens search. Type part of a command; use the arrow keys to select a result, press Enter to run the command, or press Tab to edit it.
  • Up arrow searches your history starting with what you’ve already typed.
  • In search, use Ctrl+R to cycle through the filters: all computers, this computer only, this directory only, this repository only, or this shell session only.
  • Like most shells, Atuin doesn’t add commands that begin with a space to your history. This keeps individual commands that contain passwords out of your history.
  • atuin search --exit 0 --after "yesterday 3pm" make searches directly in the terminal, in this example for all successful make commands since 3 p.m. yesterday.
  • atuin stats shows you which commands you use most often.

If you want the up arrow to work with your shell again, run atuin setup once more and disable the option.

Manage your password, key, and account

  • atuin account change-password changes your password on the server.
  • atuin key displays your key. Changing your password doesn’t change the key, so your other computers will stay signed in.
  • atuin logout signs a computer out; its history and key remain on the computer.
  • atuin account delete deletes your account and history on the server without asking for confirmation. The history on your computers remains intact.

What Atuin can’t do

  • No web interface. Accounts, search, and sync are handled exclusively through the atuin program in the terminal.
  • No password reset by email. The server doesn’t send emails. With a manual installation, reset a forgotten password using atuin-server admin user set-password. A lost key can’t be replaced.
  • No per-account storage limits. If registration is open, any account can upload as much data as it wants. Keep registration closed for this reason.

Conclusion

With your own Atuin server, you can access your complete command history on all your computers, protected with end-to-end encryption and stored on your own VPS. The quickest way to get started is with the One-Click App: queue the installation, install atuin on your computer, register an account, and then close registration. If you want to manage the server yourself, manual installation with Docker Compose gives you full control.

Free tools

Related tools for servers and developers

View all

FAQ

Frequently asked questions

The One-Click App is the quickest option: the sync server is available over HTTPS on your domain within minutes, and the One-Click App sets up the database and certificate. You can install updates in the dashboard under App Update. Manual installation with Docker Compose is useful if you don’t use One-Click Apps on your server, want to run Atuin behind your own reverse proxy, or want to create accounts directly on the server while registration is closed.
No. Atuin encrypts each entry on the computer before sending it to the server. The key stays on the user’s devices. The server stores only encrypted records, along with the account’s username and email address.
Yes, as long as ATUIN_OPEN_REGISTRATION is set to true. Other users can’t read your history, but they can use storage on your server. Create your account, then set the value to false (One-Click App: gear icon > App Environment, change the value, and click Save; the app will restart automatically). Sign in on additional computers with atuin login; registration doesn’t need to be open for this.

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.