Prepare the server and domain
- Use Ubuntu Server 24.04 LTS on an x86-64 VPS with SSH access and sudo. Verify the SSH host fingerprint with your provider before trusting it.
- Allow package and image downloads. Check for at least 5 GiB free on the filesystems that hold /opt and Docker data.
- Create a DNS A record pointing to the VPS public IPv4 address. Add an AAAA record only if public IPv6 reaches the same VPS.
- Allow inbound TCP 80 and 443 at the provider firewall and any active host firewall. Keep your SSH access rule. Keep Safe’s backend, PostgreSQL and the Docker API off the public network.
- Use a Windows version of Safe that offers Personal Server under Settings → Sync. Keep your master password and recovery key available on the client side.
Run the commands below in the Ubuntu SSH session. Replace sync.example.com with your domain.
Install prerequisite tools on a fresh Ubuntu server
sudo apt-get update &&
sudo apt-get install -y python3 iproute2 ca-certificates tar coreutils curl dnsutilscat /etc/os-release
uname -m
df -h /opt
sudo ss -ltnp '( sport = :80 or sport = :443 )'
dig +short A sync.example.com
dig +short AAAA sync.example.comInstall with the Safe setup wizard
Get the package and checksum
Use a trusted Safe Sync Server release for Linux amd64. Obtain the .tar.gz archive and its matching .sha256 from the same release. The commands use the dev.6 package as an example. Substitute your own package name if it differs.
Build the installer archive from a Safe source checkout
Install Docker Engine with Buildx on the build machine. Select a trusted Safe source revision for the release you intend to build and run the package builder from its root. Use the matching release version in the command, then transfer both output files from the same build.
python3 personal_sync_server/installer/build_package.py --version v0.3.0-dev.6 --arch amd64 --output dist/serverTransfer, verify and extract
On the VPS, create a working folder, then transfer both files to it over SFTP or SCP.
mkdir -p ~/safe-installThis PowerShell example runs from the folder containing the archive on your Windows PC. Enter the SSH user and address supplied by your provider.
$Vps = Read-Host 'SSH user and address'
$Archive = 'Safe-Sync-Server-v0.3.0-dev.6-linux-amd64.tar.gz'
scp $Archive "$Archive.sha256" "${Vps}:safe-install/"Back in the Ubuntu SSH session, verify the checksum before extracting to a fresh folder. A matching checksum confirms the file was transferred intact. Use a trusted channel to establish who published it.
package=Safe-Sync-Server-v0.3.0-dev.6-linux-amd64
cd ~/safe-install &&
sha256sum -c "$package.tar.gz.sha256" &&
tar -xzf "$package.tar.gz" &&
cd "$package" &&
pwd -PStart the wizard and choose a database
sudo python3 -u installer.pyRun this from the extracted directory. Choose your language and option 1 for a new installation. The wizard checks the archive manifest, initializes the backend and verifies that the server ID persists across a restart.
Choose how to serve HTTPS
Enter the domain without a scheme or path, then all of its public IP addresses separated by spaces. The wizard compares them with DNS and checks web ports before asking you to continue.
From another computer, verify HTTPS before entering any device token. Expect a JSON response with server_id and protocol. If the check fails, use the status or diagnostics menu to finish setup.
curl -fsS https://sync.example.com/v1/server-infoConnect the first PC and restore on the second
- After HTTPS passes, create and name the first vault in the wizard. Note its storage_id. If you skipped this step, open Manage installation and choose 4 to create a vault.
- Issue a token with Read and write access for the first PC. Use a recognizable label such as Home PC. Save the token while the wizard displays it because it is shown once. To add another PC, use option 1 in the installed management menu and select the same storage_id.
- On the first PC, unlock the existing vault. Open Settings → Sync → Personal Server → Set up. Enter your base HTTPS address and the device token, select Check connection, and verify the server ID, storage ID and write permission. For fresh storage, Safe should report that it is empty. Choose Connect this vault.
- Wait for a confirmed revision in Personal Server → Manage. Use Sync now if needed. On the second PC, open Safe with a separate empty local location and choose Sync → Personal Server. Enter the same address and the second PC’s token, then check the connection and IDs. When Safe finds the vault copy, choose Restore vault from server.
- Unlock the restored copy locally with the first vault’s master password. Keep both vaults open and test an edit with a dummy entry in each direction. Check that both PCs show the same confirmed revision and remove the test entry afterwards.
Manage devices, backups and updates
On the VPS, start the installed wizard, choose your language, then select 2 for Manage installation.
sudo python3 /opt/safe-sync-server/installer.py- Devices (1–3). Add one token per device. List devices to find the device_id and permissions. Revoke the exact token if it is exposed or the PC is lost, then issue a replacement as needed. Revocation cuts off server access permanently for that token.
- Vaults and status (4–6). Create or list vaults and their revisions, then check containers, DNS and HTTPS. Use these checks after rebooting the host.
- Backup (7). The wizard writes the database backup and its SHA-256 file under /opt/safe-sync-server/backups. Verify SHA-256, copy both to protected storage off the VPS, and keep the setup configuration and TLS data separately in protected storage.
- Restore (8). Test the backup on a separate ready installation with the same database type. While clients are paused, verify the restored server ID, storage IDs, revisions and device access. Before reopening access, revoke again any tokens that were revoked after the backup date.
- Update (9). Back up first, verify the new archive and unpack it into a new directory. In the installed wizard, provide the path to that directory. Afterwards, check HTTPS, the same server ID, device access and sync on both PCs.
Manual setup from Safe source files
Use this route if you manage Docker Compose and HTTPS yourself. In the trusted Safe source checkout, open personal_sync_server on the Docker host. The commands below start a fresh SQLite installation.
cd personal_sync_server
sudo docker compose build &&
sudo docker compose run --rm sync init &&
sudo docker compose up -d
sudo docker compose ps
curl --fail http://127.0.0.1:8787/v1/healthExpect a status of ok. Adapt nginx.example.conf from the source using your domain and valid certificate paths. Validate and reload Nginx. Keep the published backend on 127.0.0.1:8787, and verify HTTPS from another computer.
sudo nginx -t && sudo systemctl reload nginx
curl -fsS https://sync.example.com/v1/server-infoCreate the vault and substitute its returned storage_id for STORAGE_ID in both token commands. Each token is displayed once. Add --read-only when issuing a token for a PC that should only retrieve copies.
sudo docker compose exec sync python -m personal_sync_server create-vault "My Safe"
sudo docker compose exec sync python -m personal_sync_server create-token STORAGE_ID "Home PC"
sudo docker compose exec sync python -m personal_sync_server create-token STORAGE_ID "Work PC"Troubleshooting
Open Diagnose (3) from the installed wizard, or Status (6) from the management menu. Retry the relevant check after making a change.
The domain or certificate check fails
Check A and AAAA records, port 80/443 access, the server clock and the certificate chain. If another web service already uses those ports, integrate Safe through that HTTPS proxy. Keep certificate verification enabled.
The token or permissions are rejected
Compare server_id and storage_id with the first PC. Check the device list to verify that the token is active and has write permission for two-way sync. If it was lost or revoked, issue a new token for that storage.
Changes are missing or conflict
Unlock both vaults, close entry editors, try Sync now and compare confirmed revisions. Offline edits stay local until Safe can sync. If edits conflict, open Resolve conflict and choose which version to keep before applying your choices.
Setup fails before it is finished
Check free disk space, Docker availability and that the archive matches the checksum from the same release. If an installation is already recorded, use the installed wizard to check its state before repeating any action.