Skip to main content
This guide uses Ubuntu 22.04. Every command is exact and copy-paste ready.
1

Provision a VPS

Any provider works: DigitalOcean, Hetzner, Linode, Vultr. Minimum recommended: 2 vCPU, 2 GB RAM, 20 GB SSD. Ubuntu 22.04 LTS.After provisioning, SSH in as root:
Create a non-root user:
Switch to the deploy user for the rest of this guide:
2

Install Docker

3

Clone your repository

4

Configure environment variables

Fill in all production values. Key differences from local development:
5

Generate production JWT keys

Copy the base64 output into .env as JWT_PRIVATE_KEY and JWT_PUBLIC_KEY, then delete the key files:
6

Start services with production Docker Compose

Check that all containers are running:
You should see api, frontend, postgres, and redis all in running state.
7

Run migrations and seed

8

Install and configure Nginx

Create the Nginx configuration:
Paste this configuration (replace yourdomain.com and api.yourdomain.com with your actual domains):
Enable the configuration:
9

Set up SSL with Let's Encrypt

Certbot modifies the Nginx configuration to add HTTPS and sets up automatic renewal. Verify:
10

Configure Stripe production webhook

Now that your API has a public HTTPS URL:
  1. Stripe Dashboard → Developers → WebhooksAdd endpoint
  2. URL: https://api.yourdomain.com/api/v1/webhooks/stripe
  3. Events: checkout.session.completed, customer.subscription.updated, customer.subscription.deleted, invoice.payment_failed, invoice.payment_succeeded
  4. Copy signing secret → update STRIPE_WEBHOOK_SECRET in .env
  5. Restart the API: docker compose -f docker-compose.prod.yml restart api
11

Verify

Open https://yourdomain.com in a browser and log in with admin credentials.

Keeping the application updated

To deploy a new version:

Viewing production logs