Skip to content

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.

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.

Only the FastAPI service is code you ship. Supabase, Redis and blob storage are services it talks to.

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.

Copy .env.example to .env and fill it in. The main groups:

Terminal window
# Database (Supabase connection string, asyncpg driver)
DATABASE_URL=postgresql+asyncpg://...
# Redis
REDIS_URL=redis://redis:6379/0
# Supabase Auth (verify only)
SUPABASE_URL=https://your-project-ref.supabase.co
SUPABASE_ANON_KEY= # publishable key; the app fetches it from the server
SUPABASE_JWT_SECRET= # blank on projects from 2025-10-01 onward
SUPABASE_SERVICE_ROLE_KEY= # server-only secret key; never ship to clients
# Blob storage (S3-compatible)
S3_ENDPOINT_URL=https://...
S3_BUCKET=clipboard-blobs
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
AWS_REGION=auto
# App
APP_CORS_ORIGINS=tauri://localhost,http://localhost:1420
DEFAULT_BLOB_QUOTA_BYTES=52428800 # 50 MB per user
ADMIN_API_KEY= # blank disables the admin endpoints

APP_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:

Terminal window
docker-compose up

Then apply migrations:

Terminal window
uv run alembic upgrade head

Check that it is running. A healthy server answers with status 200:

Terminal window
curl http://localhost:8000/internal/healthz

Migrations 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.

A deploy ships code, not schema. Until you apply the migration, routes that need it fail.

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.

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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_...";

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.

Google sign-in needs all three of these, or it fails after the consent screen with no useful error:

  1. In Supabase, under Authentication, Providers, enable Google with the client ID and secret from Google Cloud Console.
  2. In Google Cloud Console, add https://<project-ref>.supabase.co/auth/v1/callback to the OAuth client’s authorized redirect URIs.
  3. In Supabase, under Authentication, URL Configuration, add all three of http://127.0.0.1:53170, http://127.0.0.1:53171 and http://127.0.0.1:53172 to the redirect URLs.
Each hop needs its own setting. Miss step 3 and the consent screen succeeds, but the app waits until it times out.

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.

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.