Self-hosting
You can run your own backend and point the app at it. The server stores encrypted items and
holds no key that opens them, so self-hosting does not change the security model; you see the
same metadata any operator does (listed in the security model). This page is a provider-agnostic overview;
the full operational runbook, including one worked VPS setup, hardening, and the deploy
pipeline, is in the backend repo’s
docs/DEPLOY.md.
What you are running
Section titled “What you are running”Four parts. Only the first is code you ship; the other three are services it talks to.
| Component | Role |
|---|---|
| FastAPI service | The API and the /ws realtime endpoint. Stateless; run one or many replicas. |
| Redis | WebSocket pub/sub fan-out and device presence. Required. Holds only ephemeral state. |
| Postgres + Auth | Ciphertext store and identity. Supabase provides both; the backend verifies its tokens and never signs one. |
| Blob storage | Encrypted image and file blobs, via presigned URLs. Any S3-compatible store (Cloudflare R2, MinIO, AWS S3). |
Redis is not optional: realtime and presence depend on it. Text and note sync work without blob storage; only large image and file attachments need it.
<<Settings > Developer>>
Desktop app
<<stateless>>
FastAPI service
<<Supabase, ciphertext>>
Postgres
<<issues tokens>>
Supabase Auth
<<required, ephemeral>>
Redis
<<S3, optional>>
Blob storage
External services
Section titled “External services”Supabase owns identity. Create a project and collect its connection string, project URL, and
a server-only secret key. Since 2025-10-01 Supabase signs tokens with asymmetric keys verified
via JWKS, so on a new project you leave the legacy JWT secret blank; the backend detects the
algorithm per token. The exact env values and the pooler-vs-direct-host detail are in
docs/DEPLOY.md.
S3-compatible blob storage. Create a bucket and an API token. The bucket must already exist; the service only presigns URLs, it never creates buckets.
Configure
Section titled “Configure”Copy .env.example to .env and fill it in. The main groups:
# Database (Supabase connection string, asyncpg driver)DATABASE_URL=postgresql+asyncpg://...
# RedisREDIS_URL=redis://redis:6379/0
# Supabase Auth (verify only)SUPABASE_URL=https://your-project-ref.supabase.coSUPABASE_ANON_KEY= # publishable key; the app fetches it from the serverSUPABASE_JWT_SECRET= # blank on projects from 2025-10-01 onwardSUPABASE_SERVICE_ROLE_KEY= # server-only secret key; never ship to clients
# Blob storage (S3-compatible)S3_ENDPOINT_URL=https://...S3_BUCKET=clipboard-blobsAWS_ACCESS_KEY_ID=...AWS_SECRET_ACCESS_KEY=...AWS_REGION=auto
# AppAPP_CORS_ORIGINS=tauri://localhost,http://localhost:1420DEFAULT_BLOB_QUOTA_BYTES=52428800 # 50 MB per userADMIN_API_KEY= # blank disables the admin endpointsAPP_CORS_ORIGINS must include the app’s origin, which is tauri://localhost by default. Leave
ADMIN_API_KEY blank unless you need the admin endpoints; blank makes them return 503.
The repo ships a Dockerfile, a dev docker-compose.yml (with local Postgres, Redis, and
MinIO), and a docker-compose.prod.yml. For a local stack:
docker-compose upThen apply migrations:
uv run alembic upgrade headCheck that it is running. A healthy server answers with status 200:
curl http://localhost:8000/internal/healthzMigrations are never applied automatically by the deploy: a merged migration has not reached the database until someone runs it. Apply them deliberately after deploying new code.
Code
<<with a migration>>
Merge to main
<<needs new schema>>
New code live
Database
<<not applied>>
Migration file
<<routes fail>>
Old schema
<<routes work>>
Current schema
TLS and the desktop app
Section titled “TLS and the desktop app”Put a reverse proxy in front of the service for TLS (the sample setup uses Caddy for automatic
certificates). The app accepts https:// anywhere. It also accepts plain http:// to the
machine it runs on, and, once you turn on Allow plain http on private networks in the
Developer page, to a LAN, Tailscale or .local address; everyone on that network can read
that traffic, so use it for a home lab, not across the internet. A self-signed certificate
works too: pin its SHA-256 fingerprint in the same section. The pin covers the server URL
only; Supabase keeps its public certificate.
Point the app at your server
Section titled “Point the app at your server”The app needs three values:
| Value | Where to find it |
|---|---|
| Server URL | Your deployed API, for example https://sync.example.com |
| Supabase project URL | Supabase, Settings, API Keys, Project URL |
| Supabase publishable key | Supabase, Settings, API Keys. It starts with sb_publishable_; older projects call it the anon key |
Never use the secret key (sb_secret_). It gives full access to your project, and anything compiled into the app or served to it can be read by anyone who has a copy.
Set SUPABASE_ANON_KEY in the server’s .env to the publishable key. The server then
answers GET /.well-known/orange-copy-paste.json with its Supabase URL, that key, the reset
page and its versions, so users only have to type the server URL.
In the installed app:
- Open Settings, pick Developer in the list beside the settings to jump to it, and turn on Developer options. Confirm, and the settings below the switch appear.
- Sign out if you are signed in: the Backend group hides its form while a session, a device record and the account keys belong to the current server, and shows an Open Account button instead.
- Under Backend, enter the server URL and press Discover. The other fields fill in from the server; type them yourself if your server does not provide them.
- Press Test connection. It checks the health route, that the server speaks the API version this app expects, that the WebSocket route is reachable through your proxy, and that Supabase answers for the key. If the certificate is not trusted, the report shows its fingerprint and offers to pin it.
- Press Save, then sign up or sign in on the Account screen. Your account and this device should appear.
Reset to default, the row above Update feed in the Developer group, returns to the server the app shipped with after a confirmation. Sign out first; the session and keys belong to the server you are on. Turning Developer options off does not undo the server; the steps are under How to undo a developer setting. What the section shows is listed on the Settings page.
For a build of your own, you can also compile the values in, so users never type them: set the
three constants at the top of src-tauri/src/sync/config.rs in the app. They are safe to
commit. If they are empty, the Account screen says the build has no sync endpoints.
const DEFAULT_SERVER_URL: &str = "https://sync.example.com";const DEFAULT_SUPABASE_URL: &str = "https://your-project-ref.supabase.co";const DEFAULT_SUPABASE_ANON_KEY: &str = "sb_publishable_...";Updates for a fork
Section titled “Updates for a fork”A fork signs its own bundles and publishes its own feed. Users can read updates from it
under Update feed on the Developer page: the feed URL and the minisign public key the
fork’s bundles are signed with. Leave the key empty only for a mirror of the default feed,
which carries bundles signed with the built-in key. The release pipeline that produces a feed
is described in the app repo’s
docs/releasing.md.
Set up Google sign-in
Section titled “Set up Google sign-in”Google sign-in needs all three of these, or it fails after the consent screen with no useful error:
- In Supabase, under Authentication, Providers, enable Google with the client ID and secret from Google Cloud Console.
- In Google Cloud Console, add
https://<project-ref>.supabase.co/auth/v1/callbackto the OAuth client’s authorized redirect URIs. - In Supabase, under Authentication, URL Configuration, add all three of
http://127.0.0.1:53170,http://127.0.0.1:53171andhttp://127.0.0.1:53172to the redirect URLs.
<<opens your browser>>
Desktop app
<<consent screen>>
<</auth/v1/callback>>
Supabase
<<signed in>>
Desktop app
<<first free port>>
127.0.0.1
Step 3 is the easy one to miss. The app receives the sign-in on the first free port of those
three on the user’s computer. If they are not allowed, Google’s consent succeeds but Supabase
will not send the user back, and the app waits until it times out after 5 minutes. The ports are
fixed in src-tauri/src/sync/oauth.rs.
Deeper operations
Section titled “Deeper operations”Migrations in detail, the build-on-box deploy pipeline, rollback, log retention, metrics, and
troubleshooting are all in the backend
docs/DEPLOY.md.
That runbook documents one concrete setup; adapt the host-specific parts to wherever you run it.