# Self-hosted Atuin

Atuin sync is open-source and we commit to self-hosted users.

## Setup

To use a self-hosted server, point Atuin at it:

```shell
atuin setup --only --sync https://atuin.example.com
```

Setup sets [`sync_address`](/reference/config/general/#sync_address) in
`~/.atuin/config.toml`. If this machine is logged in to another server, setup
logs it out. `atuin setup` without `--only` asks for the address on its Sync
step instead:

<VHSTape title="atuin setup with sync switched to a self-hosted Atuin at https://atuin.example.com. Setup finishes by asking you to run atuin login.">
  Set Width 1376
  Set Height 940
  # A machine that Atuin isn't set up on yet; see vhs/shell/.zshrc.
  Env DOCS_NEW_USER "1"
  Sleep 500ms
  Type "atuin setup"
  Enter
  Wait+Screen@30s /Continue/
  Sleep 1.5s
  Down@300ms 4
  Enter
  Wait+Screen@10s /Where should/
  Sleep 1.5s
  Down
  Sleep 400ms
  # Picking a self-hosted server moves on to its address.
  Enter
  Sleep 800ms
  Type "https://atuin.example.com"
  Sleep 800ms
  Enter
  Sleep 600ms
  Enter
  Wait+Screen@1m /is ready/
  Sleep 3s
</VHSTape>

Then create an account on your server, or log in to the account you already
have there:

```shell
# Create a new account
atuin register -u <USERNAME> -e <EMAIL>

# Log in to an existing account
atuin login -u <USERNAME>
```

Both commands ask for your password. `atuin login` also asks for your
encryption key, which `atuin key` prints on a machine that's already logged in.
See [`atuin account`](/reference/commands/account/) for every flag.

#### Manual Configuration

You can also edit the [`sync_address`](/reference/config/general/#sync_address) in
the `~/.atuin/config.toml` file and set the value there, or set the
`ATUIN_SYNC_ADDRESS` environment variable:

```toml
# At the start of the file:
sync_address = "https://self-hosted-atuin"
```