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
Recommended for Production
- CPU: 4+ cores
- RAM: 8GB+
- Storage: 50GB+ SSD
- Bandwidth: Unlimited or high limit
- Load Balancer: For high availability
Deployment Options
Choose your deployment method:- Docker Compose - Easiest, recommended for most
- PM2 with Node.js - Direct deployment
- 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-Hosted PostgreSQL (Optional)
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:
Performance Optimization
Enable Gzip in Nginx
Add to/etc/nginx/nginx.conf:
Enable Caching
In Nginx configuration:Scaling Considerations
Horizontal Scaling
For high traffic:- Deploy multiple instances behind a load balancer
- Use Redis for session storage
- Use CDN for static assets
- 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:- Set up monitoring and alerting
- Configure automated backups
- Test disaster recovery procedures
- Optimize performance based on usage
- Plan for scaling as you grow
Need help with self-hosting? Join our community or consider our hosted service for a managed solution.