Deployment
Using Docker Compose (Recommended)
Step 1 — Build the frontend
pnpm bundleThis compiles the React app and embeds it inside the fastify-admin package so the API server can serve it.
Step 2 — Set production environment variables
DB_HOST=postgresDB_NAME=fastifyadminDB_USER=postgresDB_PASSWORD=your-strong-password-here
ADMIN_JWT_SECRET=a-very-long-random-string-here
ADMIN_NAME=My AppADMIN_PORT=3001ADMIN_BASE_URL=https://your-domain.comADMIN_SIGNUP_ENABLED=false
SMTP_HOST=smtp.example.comSMTP_PORT=587SMTP_USER=noreply@example.comSMTP_PASS=your-email-passwordSMTP_FROM=noreply@example.comStep 3 — Deploy
docker compose up -dStep 4 — Create the first admin user
docker compose exec api pnpm create-adminProduction Checklist
- Change
ADMIN_JWT_SECRETto a long random string (at least 32 characters) - Use a strong database password
- Set
ADMIN_SIGNUP_ENABLED=false - Configure a real SMTP server
- Set
ADMIN_BASE_URLto your actual domain - Enable HTTPS via a reverse proxy (Nginx or Caddy)
Serving Behind a Reverse Proxy
server { listen 443 ssl; server_name your-domain.com;
ssl_certificate /path/to/cert.pem; ssl_certificate_key /path/to/key.pem;
location / { proxy_pass http://localhost:3001; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; }}In production, the API serves both the API and the pre-built web UI from port 3001.
Environment Summary
| Setting | Development | Production |
|---|---|---|
| Frontend | Vite dev server (port 5173) | Bundled into API (port 3001) |
| Database | Docker on localhost | Managed DB or Docker |
| HTTPS | Not needed | Required |
| Signup | Enabled | Disable after setup |