Overview
Manifest deploys as a single service that serves both the API and frontend. You can deploy it using:- Docker — Containerized deployment (recommended)
- Railway — Managed platform with one-click deploy
- Manual — Build and run with Node.js
Docker Deployment
Prerequisites
- Docker and Docker Compose installed
- PostgreSQL 16 (can run in Docker or use external database)
Step 1: Create Docker Network
Step 2: Start PostgreSQL
If you don’t have an existing PostgreSQL instance:Step 3: Build Manifest
Clone the repository and build:- Turborepo builds the frontend (Vite) first
- Then builds the backend (NestJS)
- Frontend static files are copied to
packages/backend/dist/public/
Step 4: Create Dockerfile
Create aDockerfile in the project root:
Step 5: Build and Run Container
Docker Compose (Alternative)
Createdocker-compose.yml:
.env file:
Railway Deployment
Railway provides managed PostgreSQL and automatic HTTPS.Create Railway project
- Sign in to Railway
- Click “New Project”
- Select “Deploy from GitHub repo”
- Connect your Manifest fork
Add PostgreSQL
- Click “New” → “Database” → “PostgreSQL”
- Railway automatically provisions a database
- Copy the connection string from the “Connect” tab
Configure environment variables
Add these variables to your Manifest service:Railway automatically sets
RAILWAY_PUBLIC_DOMAIN with your service URL.Configure build settings
Railway should auto-detect the setup. If needed, manually set:
- Build Command:
npm run build - Start Command:
npm start - Root Directory:
/
Railway Public Networking
Railway generates a public URL likemanifest-production.up.railway.app. To use a custom domain:
- Go to your service settings
- Click “Networking” → “Custom Domain”
- Add your domain and configure DNS as instructed
- Update
BETTER_AUTH_URLto your custom domain
Manual Deployment
Deploy directly on a VPS or bare metal server.Prerequisites
- Node.js 22.x or later
- PostgreSQL 16 running and accessible
- Git for cloning the repository
Process Management with PM2
For production, use a process manager like PM2:ecosystem.config.js:
Systemd Service (Alternative)
Create/etc/systemd/system/manifest.service:
Reverse Proxy (Nginx)
For production deployments, put Nginx in front of Manifest for HTTPS and load balancing. Create/etc/nginx/sites-available/manifest:
Health Checks
Manifest exposes a public health check endpoint:- Docker health checks
- Kubernetes liveness probes
- Load balancer health checks
- Uptime monitoring
Troubleshooting
Server won’t start
Check environment variables:BETTER_AUTH_SECRET and DATABASE_URL are set.
Check database connection:
Migrations fail
Migrations run automatically on startup. If they fail:- Check PostgreSQL is running and accessible
- Verify the user has DDL permissions (
CREATE TABLE,ALTER TABLE) - Check for conflicting manual schema changes
Cannot access from outside container
EnsureBIND_ADDRESS=0.0.0.0 (not 127.0.0.1).
Test from host:
Next Steps
Configuration
Configure environment variables and server options
Database Setup
Advanced database configuration and backup strategies