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.Connect your repository
- Push your code to GitHub, GitLab, or Bitbucket
- Go to vercel.com and sign up
- Click Add New Project
- Import your repository
Configure project settings
- Framework Preset: Next.js
- Root Directory:
apps/lms - Build Command:
npm run build - Output Directory:
.next
Add environment variables
In the Vercel dashboard, add all your environment variables:
Use production keys, not test keys!
Vercel CLI Deployment
Alternatively, deploy from the command line:Deploy to Railway
Railway offers a great deployment experience with built-in database support.Create Railway account
Sign up at railway.app
Create new project
- Click New Project
- Select Deploy from GitHub repo
- Authorize Railway and select your repository
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
Add environment variables
In the Railway dashboard:
- Go to Variables tab
- Add all your environment variables
- Click Deploy
Deploy with Docker
For self-hosting with full control over your infrastructure.Create Dockerfile
CreateDockerfile 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.Create S3 Bucket
- Sign in to AWS Console
- Navigate to S3
- Click Create bucket
- Choose a unique bucket name (e.g.,
easelms-production) - Select a region close to your users
- Uncheck “Block all public access” (we’ll use signed URLs)
- Click Create bucket
Create IAM User
- Go to IAM → Users
- Click Add users
- User name:
easelms-s3-user - Access type: Programmatic access
- Attach policy: AmazonS3FullAccess (or create custom policy)
- Save the Access Key ID and Secret Access Key
Optional: CloudFront CDN
For better performance, set up CloudFront:Create CloudFront Distribution
- Go to CloudFront in AWS Console
- Click Create Distribution
- Origin domain: Select your S3 bucket
- Origin access: Legacy access identities
- Create new OAI and grant bucket permissions
- Click Create distribution
Database Migration in Production
Run the database migration on your production Supabase instance:Run migration
- Go to SQL Editor
- Paste contents of
apps/lms/supabase/migrations/database_setup.sql - Click Run
Post-Deployment Configuration
Configure Webhook Endpoints
For payment gateways, set up webhooks:Stripe Webhooks
- Go to Stripe Dashboard → Webhooks
- Click Add endpoint
- Endpoint URL:
https://yourdomain.com/api/webhooks/stripe - Select events:
payment_intent.succeeded,payment_intent.payment_failed - Save the webhook signing secret to your environment variables
Flutterwave Webhooks
- Go to Flutterwave Dashboard → Settings → Webhooks
- Webhook URL:
https://yourdomain.com/api/webhooks/flutterwave - Save the secret hash
Verify Email Sending
Test that SendGrid emails are working:- Create a test account on your production site
- Verify you receive the welcome email
- Check spam folder if not received
- 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 innext.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:- Go to your S3 bucket
- Properties → Versioning
- 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:- Customize your platform
- Set up your first course
- Configure platform branding
- Test payment flows
- Monitor performance and errors