wwwwwwwwwwwwwwwwwww

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:

bun onboard

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.

bun run ci release

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:

cp .env.production.example .env.production

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:

wal_level = logical max_replication_slots = 4 max_wal_senders = 4

Domain Setup

  1. Point your domain to your server (A record for Uncloud, or ALB for SST)
  2. Set ONE_SERVER_URL and BETTER_AUTH_URL to your domain
  3. Set VITE_PUBLIC_ZERO_SERVER to 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:

  1. Runs checks and tests
  2. Builds the production app
  3. Deploys to your configured platform
  4. 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:

bun tko env sync-to-github

This pushes your environment variables to GitHub repository secrets so the CI pipeline can deploy.

Monitoring

View logs after deployment:

# Uncloud
bun tko uncloud logs
# SST
bun tko ci tail

Health checks run automatically after each deploy, verifying:

  • Containers are running and healthy
  • HTTP endpoints respond
  • Database connections work

Edit this page on GitHub.