Skip to main content

Deployment

Markup can be deployed as a standard Next.js application using platforms such as:
  • Vercel
  • Docker
  • VPS / Dedicated Servers
  • Railway
  • Coolify
  • Render
The application requires:
  • PostgreSQL database
  • Environment variables configured
  • Prisma migrations applied

Production Requirements

Before deployment, ensure you have:
  • Node.js 18+
  • PostgreSQL database
  • WorkOS application configured
  • Production environment variables configured
  • HTTPS enabled for authentication callbacks

Required Environment Variables

Example production configuration:

Build the Application

Install dependencies:
Generate the Prisma client:
Build the production application:
Start the production server:

Database Migrations

Run Prisma migrations before starting production deployments:
This applies all pending migrations safely in production.

Deploying to Vercel

1. Push Repository to GitHub

Ensure your repository is committed and pushed.

2. Import Project into Vercel

  1. Open the Vercel dashboard
  2. Import the GitHub repository
  3. Select the project
  4. Configure environment variables

3. Configure Environment Variables

Add all required variables from .env.local into:

4. Configure PostgreSQL

You can use:
  • Neon
  • Supabase
  • Railway PostgreSQL
  • Vercel Postgres
  • Self-hosted PostgreSQL
Ensure SSL is enabled if required by the provider.

5. Deploy

Vercel automatically runs:
After deployment, run migrations:

Deploying with Docker

Docker Compose

Dockerfile

Deploying on a VPS

Clone the Repository


Install Dependencies


Configure Environment Variables

Create:
Add all required production variables.

Generate Prisma Client


Run Migrations


Build Application


Start Server


Reverse Proxy Example (Nginx)


Recommended Production Setup

Recommended stack:
  • Next.js application
  • PostgreSQL database
  • Nginx reverse proxy
  • HTTPS via Let’s Encrypt
  • PM2 or Docker for process management

PM2 Example

Install PM2:
Start the application:
Save PM2 configuration:
Enable startup:

Updating Production Deployments

Pull latest changes:
Install dependencies:
Run migrations:
Rebuild application:
Restart application:

Security Recommendations

  • Use HTTPS in production
  • Enable PostgreSQL SSL
  • Restrict database access
  • Never expose .env files publicly
  • Use strong secrets
  • Rotate API keys periodically
  • Enable automatic backups

Troubleshooting

Prisma Migration Failures

Check migration status:

Application Fails to Start

Verify:
  • Environment variables exist
  • Database is reachable
  • Prisma client is generated
  • Build completed successfully

WorkOS Authentication Errors

Ensure:
  • Redirect URI matches production domain
  • HTTPS is enabled
  • Callback URLs are configured in WorkOS

Deployment Checklist

  1. Environment variables configured
  2. PostgreSQL database running
  3. Prisma migrations applied
  4. HTTPS enabled
  5. WorkOS redirect URI configured
  6. Application successfully built
  7. Backups configured
  8. Monitoring/logging enabled