Skip to main content
This guide covers self-hosting EaseLMS on your own server infrastructure, giving you complete control over your data and deployment.

Why Self-Host?

Self-hosting EaseLMS provides:
  • Complete control over your data and infrastructure
  • No vendor lock-in or platform dependencies
  • Custom security and compliance requirements
  • Cost optimization for large-scale deployments
  • Ability to modify and extend the platform
For most users, we recommend using managed platforms like Vercel or Railway. Self-hosting requires more technical expertise.

System Requirements

Minimum Requirements

  • CPU: 2 cores
  • RAM: 4GB
  • Storage: 20GB SSD
  • OS: Ubuntu 20.04+ or Debian 11+
  • Node.js: 18.0 or higher
  • Network: Public IP address
  • CPU: 4+ cores
  • RAM: 8GB+
  • Storage: 50GB+ SSD
  • Bandwidth: Unlimited or high limit
  • Load Balancer: For high availability

Deployment Options

Choose your deployment method:
  1. Docker Compose - Easiest, recommended for most
  2. PM2 with Node.js - Direct deployment
  3. Kubernetes - For enterprise scale

Option 1: Docker Deployment

The recommended approach for self-hosting.

Prerequisites

1

Install Docker

2

Verify installation

Setup Application

1

Clone repository

2

Create Dockerfile

Create apps/lms/Dockerfile:
3

Create docker-compose.yml

Create in project root:
4

Create .env file

Create .env in project root with all your environment variables:
5

Deploy

Docker Management Commands

Option 2: PM2 Deployment

Direct Node.js deployment with PM2 process manager.

Prerequisites

1

Install Node.js

2

Install PM2

Deploy Application

1

Clone and install

2

Create environment file

Create apps/lms/.env.local with all your variables.
3

Build application

4

Create PM2 ecosystem file

Create ecosystem.config.js:
5

Start with PM2

PM2 Management Commands

Nginx Reverse Proxy

Set up Nginx as a reverse proxy for better performance and SSL.
1

Install Nginx

2

Create Nginx configuration

Create /etc/nginx/sites-available/easelms:
3

Enable site

4

Install SSL certificate

Database Setup

While we recommend using Supabase’s hosted PostgreSQL, you can self-host the database too.
Self-hosting the database requires significant expertise in PostgreSQL administration, backups, and security.

Self-Hosted PostgreSQL (Optional)

Then modify your Supabase connection strings to point to your local database.

Security Hardening

Firewall Configuration

Automatic Security Updates

Fail2Ban for SSH Protection

Monitoring and Logging

Set Up Monitoring

Application Logs

Backup Strategy

Automated Backups

Create backup script /home/user/backup.sh:
Set up cron job:

Performance Optimization

Enable Gzip in Nginx

Add to /etc/nginx/nginx.conf:

Enable Caching

In Nginx configuration:

Scaling Considerations

Horizontal Scaling

For high traffic:
  1. Deploy multiple instances behind a load balancer
  2. Use Redis for session storage
  3. Use CDN for static assets
  4. Consider container orchestration (Kubernetes)

Database Optimization

  • Enable connection pooling
  • Add read replicas for read-heavy workloads
  • Regular VACUUM and ANALYZE operations
  • Monitor slow queries

Troubleshooting

Application won’t start

High memory usage

SSL certificate issues

Maintenance

Regular Updates

Health Checks

Create monitoring script:

Next Steps

After self-hosting:
  1. Set up monitoring and alerting
  2. Configure automated backups
  3. Test disaster recovery procedures
  4. Optimize performance based on usage
  5. Plan for scaling as you grow
Need help with self-hosting? Join our community or consider our hosted service for a managed solution.