Running your own sync server
MixLab encrypts everything on your machine before it syncs, so the default server at
https://sync-0.lab.mixnz.com holds your data without being able to read it. Running your own
server keeps even that encrypted copy with you. The server is open source and lives in the
server/ folder of MixLab's repository, and
there are two ways to run it.
On Cloudflare Workers
This is what the default server runs on, and Cloudflare's free plan is enough for a few people.
- Fork mixnz/mixlab.
- In the Cloudflare dashboard, create a Worker from your fork with
server/worker/as its root directory. - Under the Worker's Settings → Variables and Secrets, set
PEPPER(32 random bytes in base64) andEMAIL_API_KEYas secrets, andEMAIL_FROMandEMAIL_PROVIDERas variables. - Put your Worker's address into MixLab, as below.
Every setting, and what the free plan allows, is in the Worker's README.
In a Docker container
The image ghcr.io/mixnz/mixlab-sync-server holds the server as one binary and keeps its data in
one SQLite file. Any machine that runs Docker will do.
-
Create a
.envfile with a pepper and your email provider:umask 077 cat > .env <<EOF MIXLAB_SYNC_PEPPER=$(openssl rand -base64 32) MIXLAB_SYNC_EMAIL_FROM=noreply@example.com MIXLAB_SYNC_EMAIL_PROVIDER=resend MIXLAB_SYNC_EMAIL_API_KEY= EOF -
Save the compose file from the README as
compose.yamlbeside it, and rundocker compose up -d. -
Put a reverse proxy with TLS in front of it, and put its address into MixLab, as below.
Generate the pepper once and back it up with the database. If it changes, every account on the server is locked out. The README has the full configuration, backups, and how to check your server with the conformance suite.
Pointing MixLab at it
In Settings → Sync, press Add a server beside the Server list, type your server's
address and press Add. It has to start with https://; plain http:// works only for a server
on the same machine. Then create an account on it, the same way as on the default server.
If you already sync with another server, use Move to another server instead. It copies your account and everything in it, still encrypted, and signs you in on the new one.
This page as Markdown: https://mixnz.github.io/mixlab/en/self-hosting.md