# Run your own sync server

The same server that runs shelldeck.dev, in one command. Your vault is end-to-end encrypted either way: the server, ours or yours, only ever sees ciphertext. Self-hosting decides where that ciphertext lives. [How encryption works](https://shelldeck.dev/encryption)

## Install in three steps

1. **A Linux machine with Docker.** A VPS, a home server or a NAS: 1 CPU and 512 MB of RAM are enough, amd64 or arm64.
2. **Run the installer.** `curl -fsSL https://shelldeck.dev/self-host/install.sh | sh` It asks for a domain name and gets an HTTPS certificate by itself. Without a domain the server works over plain HTTP on your local network. The certificate comes from [Let's Encrypt](https://letsencrypt.org/) and renews itself; ports 80 and 443 must be reachable from the internet.
3. **Connect the apps.** On the sign-in screen choose “Self-hosted server?”, enter the address and create an account. The first account becomes the owner; sign-ups close after it.

## Free for personal use and small teams

Personal sync is unlimited. Organizations with shared vaults are free for up to 2 people on a server; invitations count too. For a bigger team, write to us for a license and put it into LICENSE in .env. [dizfaq@gmail.com](mailto:dizfaq@gmail.com?subject=ShellDeck%20license)

## Already using ShellDeck?

Settings → Move to another server uploads your vault to the new server and can delete the old account. A vault that lives only on one device turns on sync the same way. Other devices stay on the old server until you sign them in again.

## Server settings

In the .env file next to docker-compose.yml. Apply changes with docker compose up -d.

- **`DOMAIN`**: Domain name of the server; HTTPS is set up for it automatically. :80 for plain HTTP on the local network or behind your own proxy.
- **`SIGNUPS`**: owner — only the first account (default), closed — nobody, open — anyone.
- **`SIGNUP_EMAILS`**: Always allowed to register, comma-separated: me@example.com or a whole domain, @example.com.
- **`LICENSE`**: A license for more than 2 people in organizations, if you have one.
- **`SHELLDECK_VERSION`**: Image tag: latest or a release such as 0.4.0.
- **`HTTP_PORT, HTTPS_PORT`**: Ports on the host, 80 and 443 by default.

## Updates and backups

```
docker compose pull && docker compose up -d
```

The database is dumped into the backups folder every day; dumps are kept for 14 days. Copy them off the machine together with .env. To restore a dump:

```
docker compose exec -T postgres pg_restore -U shelldeck -d shelldeck --clean --if-exists < backups/shelldeck-YYYY-MM-DD.dump
```

## Behind your own reverse proxy

Set DOMAIN=:80 and a free HTTP_PORT, then proxy your domain to that port with WebSockets allowed: devices get changes over /v1/vaults/…/events. Apps accept plain http:// only for addresses on the local network.

## Without the installer

Download docker-compose.yml, Caddyfile and .env.example into one folder, rename .env.example to .env, fill in DOMAIN and two long random secrets, and run docker compose up -d.

[docker-compose.yml](https://shelldeck.dev/self-host/docker-compose.yml) [Caddyfile](https://shelldeck.dev/self-host/Caddyfile) [.env.example](https://shelldeck.dev/self-host/.env.example) [install.sh](https://shelldeck.dev/self-host/install.sh)

---

https://shelldeck.dev/self-hosting
