TinyShip Deployment
Guide for deploying TinyShip to production.
Choose Platform
Ask the user which deployment target they prefer:
| Platform | Best For | Framework Support |
|---|---|---|
| Docker | Self-hosted, full control | All 3 frameworks |
| Vercel | Next.js projects, zero-config | Next.js (recommended) |
| Cloudflare Workers | Edge deployment, global | TanStack Start only |
| VPS (PM2 + Nginx) | Traditional hosting | All 3 frameworks |
Then read the relevant reference file and follow the steps.
Pre-Deployment Checklist (All Platforms)
Before deploying, ensure:
- Production database is ready (PostgreSQL recommended)
- Environment variables are set for production:
APP_BASE_URL— your production domain (e.g.,https://app.example.com)BETTER_AUTH_URL— same asAPP_BASE_URLBETTER_AUTH_SECRET— a strong random secret (generate withopenssl rand -hex 32)DATABASE_URL— production database connection string
- OAuth redirect URIs updated to production domain
- Payment webhook URLs updated to production domain
- Database migrated:
pnpm db:pushagainst production database
Docker Deployment
Read references/docker-deploy.md for full steps.
Quick summary:
# Build and run with Docker Compose
docker compose --profile next up -d # or --profile nuxt / --profile tanstack
# Or build individual image
docker build -f apps/next-app/Dockerfile -t tinyship .
Vercel Deployment
Read references/vercel-deploy.md for full steps.
Quick summary:
- Push to GitHub
- Import project in Vercel Dashboard
- Set root directory to
apps/next-app - Configure environment variables
- Deploy
Cloudflare Workers
Read references/cloudflare-deploy.md for full steps.
Only available for TanStack Start. Uses D1 database and Wrangler CLI.
Read apps/tanstack-app/CF-NOTES.md for known pitfalls.
VPS (PM2 + Nginx)
Read docs/user-guide/deployment/traditional.md in the TinyShip repo.
Quick summary:
- Build the app:
pnpm build:next(or nuxt/tanstack) - Install PM2:
npm install -g pm2 - Start with PM2:
pm2 start .output/server/index.mjs --name tinyship - Configure Nginx reverse proxy to port 7001
- Set up SSL with Let's Encrypt
Post-Deployment
After deploying:
- Verify health:
curl https://yourdomain.com/api/health - Test login flow
- Update OAuth redirect URIs for all providers
- Update payment webhook URLs
- Run a test payment if payments are configured
- Set up monitoring/alerting
Reference Files in TinyShip Repo
docs/user-guide/deployment/overview.md— deployment documentation indexdocs/user-guide/deployment/docker.md— Docker deployment guidedocs/user-guide/deployment/cloud.md— cloud platform guidedocs/user-guide/deployment/cloudflare-workers.md— CF Workers guidedocs/user-guide/deployment/traditional.md— VPS/PM2 guidedocker-compose.yml— Docker Compose configurationapps/tanstack-app/CF-NOTES.md— Cloudflare Workers pitfallsapps/tanstack-app/wrangler.jsonc— Wrangler configuration