Bare Metal Overview
Process Managers
Section titled “Process Managers”Supervisor (Python Ecosystem)
Section titled “Supervisor (Python Ecosystem)”sudo apt install supervisorsudo cp snapcode.conf /etc/supervisor/conf.d/sudo supervisorctl start snapcode✅ Native Python, simple INI config, auto-restart, log management
PM2 (JavaScript Ecosystem)
Section titled “PM2 (JavaScript Ecosystem)”npm install -g pm2pm2 start server.py --name snapcode --interpreter python3pm2 save && pm2 startup✅ Cluster mode, zero-downtime reload, built-in monitoring
Reverse Proxies
Section titled “Reverse Proxies”Why Reverse Proxy?
Section titled “Why Reverse Proxy?”Client → Reverse Proxy → Backend Server(s)Benefits: SSL termination, load balancing, caching, security
Comparison
Section titled “Comparison”| Feature | Nginx | Traefik | HAProxy |
|---|---|---|---|
| Performance | High | Medium | Highest |
| Config | Simple | YAML | Complex |
| Auto SSL | Manual | ✅ Built-in | Manual |
| Docker | Manual | ✅ Auto | Manual |
| Best for | General | Microservices | High traffic |
Recommended Stacks
Section titled “Recommended Stacks”| Stack | Components | Best For |
|---|---|---|
| Simple | Supervisor + Nginx | Easy to learn, production ready |
| Modern | PM2 + Traefik | Auto SSL, zero-downtime |
| Performance | Supervisor + HAProxy | Maximum performance, enterprise |
Quick Start: Nginx + Supervisor
Section titled “Quick Start: Nginx + Supervisor”# 1. Start app with Supervisorsudo supervisorctl start snapcode
# 2. Setup Nginxsudo cp snapcode.conf /etc/nginx/sites-available/sudo ln -s /etc/nginx/sites-available/snapcode.conf /etc/nginx/sites-enabled/sudo nginx -t && sudo systemctl reload nginx
# 3. Setup SSLsudo certbot --nginx -d snapcode.yourdomain.com