Deployment
Deploy your goilerplate application to production
goilerplate includes a Dockerfile for easy deployment to any platform.
Recommended: Self-Hosted PaaS
Easiest option: Dokploy or Coolify
Self-hosted platforms that work like Heroku but on your own VPS ($5-10/month). One-click deployment, automatic SSL, built-in PostgreSQL templates.
Setup:
- Install Dokploy/Coolify on a VPS (Hetzner, DigitalOcean, Linode)
- Connect your Git repo
- Select “Dockerfile” as build method
- Add volume for
/app/data(if using SQLite) - Set environment variables
- Deploy
Alternative: Managed Platforms
Don’t want to manage a VPS?
Railway / Render / fly.io - Deploy directly from Git, automatic HTTPS, built-in PostgreSQL options.
Setup:
- Connect GitHub repo
- Select Docker/Dockerfile
- Add database if needed (or use external)
- Set environment variables
- Deploy
Alternative: Pure Docker
Deploy on any VPS with Docker:
docker build -t myapp .
docker run -d -p 8090:8090 --env-file .env -v $(pwd)/data:/app/data myapp
Set up reverse proxy (Caddy, nginx) for HTTPS.
Environment Variables
Required in production:
# Application
APP_ENV=production
APP_URL=https://yourdomain.com
JWT_SECRET=<generate-strong-secret>
# Database (choose one)
DB_DRIVER=sqlite # or pgx for PostgreSQL
DB_CONNECTION=./data/app.db # or postgres://...
# Email (Resend)
RESEND_API_KEY=re_xxxxx
[email protected]
# Payment (Polar or Stripe)
PAYMENT_PROVIDER=polar
POLAR_API_KEY=polar_sk_xxxxx
POLAR_WEBHOOK_SECRET=whsec_xxxxx
# Storage (S3-compatible)
S3_BUCKET=your-bucket
S3_ACCESS_KEY=xxxxx
S3_SECRET_KEY=xxxxx
S3_ENDPOINT= # leave empty for AWS S3
Database Options
SQLite (default): Works great for most apps. Just ensure /app/data is persisted (volume/mount).
PostgreSQL: For multi-region writes or advanced features. See PostgreSQL Guide.
Storage Options
Dev and prod: Same setup. Cloudflare R2 (recommended, 10GB free), AWS S3, DigitalOcean Spaces, or any S3-compatible service. Use separate buckets for dev and prod. See Storage.
Cost Estimate
Typical setup:
- VPS: $5-10/month (Hetzner, DigitalOcean)
- Database: SQLite (included) or external managed ($0-25/month)
- Storage: Cloudflare R2 (free tier)
- Total: $5-10/month for small-medium apps