Skip to main content
This guide covers deploying EaseLMS to production. We’ll walk through deploying on popular platforms and setting up the required services.

Pre-Deployment Checklist

Before deploying, ensure you have:
  • Supabase project created and database migrated
  • All environment variables documented
  • AWS S3 bucket configured (for production)
  • Payment gateways configured (if using paid courses)
  • SendGrid account set up (for email notifications)
  • Domain name ready (optional but recommended)

Deployment Options

EaseLMS can be deployed to various platforms:
  • Vercel - Recommended for beginners, zero-config Next.js hosting
  • Railway - Easy deployment with PostgreSQL support
  • Docker - Self-hosted with full control
  • Traditional VPS - Ubuntu/Debian server with PM2

Deploy to Vercel

Vercel provides the easiest deployment experience for Next.js applications.
1

Install Vercel CLI (optional)

2

Connect your repository

  1. Push your code to GitHub, GitLab, or Bitbucket
  2. Go to vercel.com and sign up
  3. Click Add New Project
  4. Import your repository
3

Configure project settings

  • Framework Preset: Next.js
  • Root Directory: apps/lms
  • Build Command: npm run build
  • Output Directory: .next
4

Add environment variables

In the Vercel dashboard, add all your environment variables:
Use production keys, not test keys!
5

Deploy

Click Deploy and wait for the build to complete (usually 2-3 minutes).
6

Configure domain (optional)

  1. Go to Settings → Domains
  2. Add your custom domain
  3. Update DNS records as instructed
  4. Update NEXT_PUBLIC_APP_URL to your domain

Vercel CLI Deployment

Alternatively, deploy from the command line:
Follow the prompts to deploy.

Deploy to Railway

Railway offers a great deployment experience with built-in database support.
1

Create Railway account

Sign up at railway.app
2

Create new project

  1. Click New Project
  2. Select Deploy from GitHub repo
  3. Authorize Railway and select your repository
3

Configure build settings

Railway should auto-detect Next.js. If not, set:
  • Build Command: cd apps/lms && npm install && npm run build
  • Start Command: cd apps/lms && npm start
4

Add environment variables

In the Railway dashboard:
  1. Go to Variables tab
  2. Add all your environment variables
  3. Click Deploy
5

Get deployment URL

Railway provides a URL like https://your-app.up.railway.app. Update NEXT_PUBLIC_APP_URL to this URL.

Deploy with Docker

For self-hosting with full control over your infrastructure.

Create Dockerfile

Create Dockerfile in apps/lms/:

Create docker-compose.yml

Deploy with Docker Compose

AWS S3 Setup

AWS S3 is required for production to handle file uploads and video streaming.
1

Create S3 Bucket

  1. Sign in to AWS Console
  2. Navigate to S3
  3. Click Create bucket
  4. Choose a unique bucket name (e.g., easelms-production)
  5. Select a region close to your users
  6. Uncheck “Block all public access” (we’ll use signed URLs)
  7. Click Create bucket
2

Configure CORS

In your bucket settings, go to Permissions → CORS and add:
3

Create IAM User

  1. Go to IAM → Users
  2. Click Add users
  3. User name: easelms-s3-user
  4. Access type: Programmatic access
  5. Attach policy: AmazonS3FullAccess (or create custom policy)
  6. Save the Access Key ID and Secret Access Key
4

Add to environment variables

Optional: CloudFront CDN

For better performance, set up CloudFront:
1

Create CloudFront Distribution

  1. Go to CloudFront in AWS Console
  2. Click Create Distribution
  3. Origin domain: Select your S3 bucket
  4. Origin access: Legacy access identities
  5. Create new OAI and grant bucket permissions
  6. Click Create distribution
2

Add CloudFront domain to env

Database Migration in Production

Run the database migration on your production Supabase instance:
1

Access production Supabase

Log in to your production Supabase project
2

Run migration

  1. Go to SQL Editor
  2. Paste contents of apps/lms/supabase/migrations/database_setup.sql
  3. Click Run
3

Create admin user

  1. Sign up through your production app
  2. In Supabase, go to Table Editor → profiles
  3. Find your user and change user_type to admin

Post-Deployment Configuration

Configure Webhook Endpoints

For payment gateways, set up webhooks:

Stripe Webhooks

  1. Go to Stripe Dashboard → Webhooks
  2. Click Add endpoint
  3. Endpoint URL: https://yourdomain.com/api/webhooks/stripe
  4. Select events: payment_intent.succeeded, payment_intent.payment_failed
  5. Save the webhook signing secret to your environment variables

Flutterwave Webhooks

  1. Go to Flutterwave Dashboard → Settings → Webhooks
  2. Webhook URL: https://yourdomain.com/api/webhooks/flutterwave
  3. Save the secret hash

Verify Email Sending

Test that SendGrid emails are working:
  1. Create a test account on your production site
  2. Verify you receive the welcome email
  3. Check spam folder if not received
  4. Verify sender domain in SendGrid if issues persist

SSL/HTTPS Configuration

Most platforms (Vercel, Railway) provide automatic SSL. For self-hosted:

Using Let’s Encrypt with Nginx

Monitoring and Logging

Vercel Analytics

EaseLMS includes @vercel/analytics. It’s automatically enabled on Vercel deployments.

Custom Monitoring

Consider adding:
  • Sentry - Error tracking
  • LogRocket - Session replay
  • Plausible - Privacy-friendly analytics

Performance Optimization

Enable Caching

Configure appropriate cache headers in next.config.js:

Use Image Optimization

Next.js automatically optimizes images. Ensure you’re using the <Image> component.

Backup Strategy

Database Backups

Supabase provides automatic daily backups on paid plans. For custom backups:

File Storage Backups

Enable S3 versioning:
  1. Go to your S3 bucket
  2. Properties → Versioning
  3. Enable versioning

Troubleshooting

Build fails

  • Check Node.js version (minimum 18.0)
  • Verify all dependencies are in package.json
  • Check build logs for specific errors

Environment variables not working

  • Ensure NEXT_PUBLIC_ prefix for client variables
  • Redeploy after changing environment variables
  • Check variable names match exactly

Database connection issues

  • Verify Supabase credentials
  • Check that database migration was run
  • Ensure RLS policies are enabled

File upload not working

  • Verify AWS credentials
  • Check S3 bucket permissions
  • Ensure CORS is configured

Next Steps

After deploying:
  1. Customize your platform
  2. Set up your first course
  3. Configure platform branding
  4. Test payment flows
  5. Monitor performance and errors