Deployment Overview
Deploy Takeout to production
Takeout supports two deployment platforms: Uncloud for self-hosting and SST for AWS. Both integrate with the same CI/CD pipeline and share most configuration.
Getting Started
The fastest way to set up production is the onboarding wizard:
This walks you through:
- Choosing a deployment platform
- Configuring your domain and database
- Generating auth secrets
- Setting up SSH keys (for Uncloud)
- Syncing secrets to GitHub
You can also run bun onboard --defaults for automated setup with sensible
defaults.
Platform Comparison
Uncloud
SST (AWS)
Setup time
~10 minutes
~30-60 minutes
Cost
VPS only ($5-20/mo)
Pay-as-you-go
Scaling
Manual (multi-machine supported)
Auto-scaling
Database
Self-hosted or managed
Aurora (managed)
Best for
Starting out, predictable costs
Enterprise, auto-scaling
Uncloud
Self-hosted deployment to any VPS (DigitalOcean, Hetzner, etc.). Uses Docker and Caddy for zero-config SSL.
SST Pro
AWS deployment with managed infrastructure—Aurora PostgreSQL, ECS, ALB, auto-scaling.
Deploying
bun onboard walks you through choosing a platform and configuring your
environment. Once set up, bun run ci release handles everything—building,
testing, and deploying.
There are individual scripts for each step if you need them, but the ci command does it all.
Environment Configuration
Production configuration lives in .env.production. Copy the example file to
get started:
The example file documents every variable with comments. Key sections:
- Deployment — platform, architecture, server host
- URLs — your domain for the app and Zero sync server
- Database — PostgreSQL connection strings (Zero needs 3 databases)
- Auth — secret key for Better Auth sessions
- Storage — Cloudflare R2 for file uploads
- Optional — push notifications, email, analytics
The onboarding wizard fills most of these automatically. For manual setup, the example file has everything you need.
Database Requirements
Zero sync requires PostgreSQL with logical replication enabled. You need three databases on the same host:
- Main database (your app data)
zero_cvr(client view records)zero_cdb(change database)
Most managed PostgreSQL providers support this. For self-hosted, add to
postgresql.conf:
Domain Setup
- Point your domain to your server (A record for Uncloud, or ALB for SST)
- Set
ONE_SERVER_URLandBETTER_AUTH_URLto your domain - Set
VITE_PUBLIC_ZERO_SERVERto your Zero subdomain
SSL is automatic—Caddy handles Let’s Encrypt for Uncloud, ALB handles certs for SST.
CI/CD
Both platforms use the same release pipeline. Push to main and it:
- Runs checks and tests
- Builds the production app
- Deploys to your configured platform
- Monitors health until stable
See Releasing for details on the pipeline and available flags.
Syncing to GitHub
After configuring .env.production, sync secrets to GitHub for CI:
This pushes your environment variables to GitHub repository secrets so the CI pipeline can deploy.
Monitoring
View logs after deployment:
Health checks run automatically after each deploy, verifying:
- Containers are running and healthy
- HTTP endpoints respond
- Database connections work
Edit this page on GitHub.