You can sync MorphGate through a server you run, for free. The reference server is a single program with a SQLite database. It speaks the same vault-sync/v1 protocol as morphgate.com, and the app treats both the same way.
The reference server is open source under AGPL-3.0, in the server/ folder of the MorphGate repository. Like morphgate.com, it stores only ciphertext, wrapped keys, public keys and a slow hash of each account's password proof. It never sees a master password, a hostname or a private key.
Run it
With Rust installed, from a checkout of the repository:
cargo run --release -p vault-sync-server -- --listen 127.0.0.1:8443 --db /var/lib/vault-sync/db.sqlite3
Or with Docker, from the repository root:
docker build -f server/Dockerfile -t vault-sync-server .
docker run -d -p 127.0.0.1:8443:8443 -v vault-sync:/data vault-sync-server
The image listens on port 8443 and keeps its database in /data.
With Docker Compose
This runs the server with Caddy in front of it, which gets a TLS certificate for your address and renews it. Point the address (here sync.example.com) at the machine and open ports 80 and 443 first. Save this as compose.yaml in the root of a checkout of the repository:
services:
vault-sync:
build:
context: .
dockerfile: server/Dockerfile
restart: unless-stopped
environment:
VAULT_SYNC_PUBLIC_URL: https://sync.example.com
VAULT_SYNC_REGISTRATION: open # closed, once your accounts exist
volumes:
- vault-sync:/data
caddy:
image: caddy:2
restart: unless-stopped
command: caddy reverse-proxy --from sync.example.com --to vault-sync:8443
ports:
- "80:80"
- "443:443"
volumes:
- caddy:/data
depends_on:
- vault-sync
volumes:
vault-sync:
caddy:
Then start it, and after a git pull rebuild it the same way:
docker compose up -d --build
Only Caddy is reachable from outside; the server has no port of its own on the machine. The database is in the vault-sync volume, and Caddy keeps its certificates in caddy. To close registration, change open to closed and run docker compose up -d again.
Options
--listen(VAULT_SYNC_LISTEN)- Address and port to listen on. Default
127.0.0.1:8443. --db(VAULT_SYNC_DB)- The SQLite database file. Default
vault-sync.sqlite3. --registration open|closed(VAULT_SYNC_REGISTRATION)- Whether new accounts can be created. Default
open. --blob-quota-mb(VAULT_SYNC_BLOB_QUOTA_MB)- Storage for attachments and session logs, per account's personal vaults and per team. Default 1024.
--public-url(VAULT_SYNC_PUBLIC_URL)- The server's public HTTPS address. Single sign-on needs it: identity providers send people back to
<public URL>/sso/callback. Defaulthttp://and the listen address.
Put it behind HTTPS
The server speaks plain HTTP. Put it behind a TLS reverse proxy. With Caddy, for example:
sync.example.com {
reverse_proxy 127.0.0.1:8443
}
The app warns if you enter a plain http:// address for anything but your own computer.
Close registration
Create your account first, then restart the server with --registration closed. On a closed server nobody can create an account, people you invite included, so let them create theirs before you close it, or open it again while they join.
Connect the app
- Open Sync in the sidebar and choose Your own server.
- Enter the address, for example
https://sync.example.com, and choose Check. The app shows the server's version and whether it accepts new accounts. - Enter your email and master password, and choose Enable sync.
On other devices, choose Sign in on the first screen, then Your own server and the same address. See How sync works.
What it supports
- Sync of your vault across devices, password change and recovery, the device list and signing devices out.
- Teams: organizations, invites, shared vaults, access levels, key rotation, ownership transfer and the activity log, with CSV and JSON lines download.
- Device approval, set from the team's policies in the app.
- Attachments and session logs, stored in the database, up to 25 MiB each, with the team's session log retention.
- OpenID Connect single sign-on and SCIM provisioning, set up from the command line (below).
- The account data download.
There are no plans, trials or billing: everything it supports is available to every account.
What it doesn't do yet
- Two-step verification, email verification, and changing your account's email address. A team can't turn on Require two-step verification to open the organization's vaults.
- Sending email. Creating an invite shows the invite code in the app, to pass on yourself.
- SAML single sign-on.
- An account page on the website: the app shows no Manage account.
- Rate limiting and purging old deletion markers.
Single sign-on
Register <public URL>/sso/callback as the redirect URI with your OpenID Connect provider, then:
vault-sync-server sso --db /var/lib/vault-sync/db.sqlite3 --org "Acme Ops" \
--issuer https://login.example.com --client-id morphgate --client-secret … --require
--org takes the team's id or name. --session-hours (default 12) is how long a device's sign-in lasts. --remove removes it. The client secret is stored in the database as given, so protect the database. See Single sign-on.
SCIM provisioning
vault-sync-server scim --db /var/lib/vault-sync/db.sqlite3 --org "Acme Ops" --public-url https://sync.example.com
This prints a token once; running it again replaces it, and --revoke stops it. Give your identity provider the base URL <public URL>/scim/v2/<team id>, the token as a bearer token, and map userName to the email address. Because this server sends no email, a provisioned person can't join on their own: the invite shows in the team's invites in the app, and an admin invites the address again there to get a code to pass on. See SCIM provisioning.
With Docker Compose, run these commands in the server's container. The database and public address come from its environment, so leave out --db and --public-url:
docker compose exec vault-sync vault-sync-server scim --org "Acme Ops"
Back up
Everything is in the database file, attachments and session logs included. Back it up like any SQLite database: the server writes it in WAL mode, so copy it with sqlite3 vault-sync.sqlite3 ".backup backup.sqlite3", or stop the server and copy the file together with its -wal and -shm files. With Docker Compose:
docker compose stop vault-sync
docker compose cp vault-sync:/data ./vault-sync-backup
docker compose start vault-sync
The database holds ciphertext, but also the hashes and single sign-on secrets above, so keep the backups private.
Moving between servers
To move from morphgate.com to your own server, or back:
- Let every device sync one last time with the old server, so nothing is left only on one device.
- On one device, choose Disconnect this device in the Sync panel, then Keep a copy here. Turn sync on again with the new server (New account). Your personal vault uploads there in full.
- On each other device, choose Disconnect this device, then Remove everything from this device. On the first screen, choose Sign in with the new server. Your vault downloads from it.
Your account on the old server stays until you delete it. Team vaults don't move by themselves: a team on the new server starts empty, and its items have to be created there again.
Check a server
Before you trust a server with your vault, you can check that it behaves. From a checkout of the repository, vault-conform tries every endpoint with throwaway accounts and reports what passed, what failed (with the server's answer) and what it skipped, and why:
cargo run --release -p vault-conform -- https://sync.example.com
It creates a few accounts with @example.com addresses, so run it against a test instance with registration open. See The open protocol.