Tools: I Built a Free Alternative to cPanel - Here's What I Learned

Tools: I Built a Free Alternative to cPanel - Here's What I Learned

Source: Dev.to

The Problem ## What is ServerKit? ## The Tech Stack ## Architecture Decisions ## Why Flask over FastAPI? ## Real-Time Metrics ## Dynamic Nginx Configuration ## What I Learned ## 1. Start with the UI ## 2. Security is Non-Negotiable ## 3. Real-Time Feels Premium ## 4. Don't Reinvent Everything ## Try It Last year I was managing a handful of WordPress sites and a few Python apps for clients. My options were: cPanel - $45/month per server. For 3 servers, that's $1,620/year just for a control panel. Coolify - Great for Docker but felt like overkill for WordPress sites. I don't need Kubernetes. CloudPanel - Nice and lightweight but no Docker support. I need both. HestiaCP - Free and feature-rich but the UI looks like it's from 2008. I wanted something in between: the simplicity of traditional hosting panels with the power of modern deployment tools. So I built ServerKit. ServerKit is an open-source server management panel that lets you: FastAPI is great for pure APIs, but ServerKit needs: Every second, the backend collects: The React frontend subscribes and updates the dashboard live. No polling, no page refreshes. Each app type has a Jinja2 template: When you create an app, ServerKit generates the config, symlinks it, and reloads Nginx. I built the backend first and regretted it. Users don't see your clean API - they see the interface. Start with mockups, validate the UX, then build the backend to support it. Server management panels are high-value targets. From day one: Static dashboards feel dead. Adding WebSocket-based live metrics made the app feel 10x more polished with relatively little code. Focus on the glue, not the components. GitHub: github.com/jhd3197/ServerKit MIT licensed, no telemetry, no cloud dependency. What features would make this useful for you? Drop a comment - I read everything. Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse CODE_BLOCK: metrics = { 'cpu': psutil.cpu_percent(), 'memory': psutil.virtual_memory().percent, 'disk': psutil.disk_usage('/').percent, 'network': get_network_stats() } socketio.emit('metrics', metrics, broadcast=True) Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: metrics = { 'cpu': psutil.cpu_percent(), 'memory': psutil.virtual_memory().percent, 'disk': psutil.disk_usage('/').percent, 'network': get_network_stats() } socketio.emit('metrics', metrics, broadcast=True) CODE_BLOCK: metrics = { 'cpu': psutil.cpu_percent(), 'memory': psutil.virtual_memory().percent, 'disk': psutil.disk_usage('/').percent, 'network': get_network_stats() } socketio.emit('metrics', metrics, broadcast=True) COMMAND_BLOCK: # PHP app nginx config server { listen 80; server_name {{ app.domain }}; root {{ app.path }}/public; location ~ \.php$ { fastcgi_pass unix:/run/php/php{{ app.php_version }}-fpm.sock; # ... } } Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: # PHP app nginx config server { listen 80; server_name {{ app.domain }}; root {{ app.path }}/public; location ~ \.php$ { fastcgi_pass unix:/run/php/php{{ app.php_version }}-fpm.sock; # ... } } COMMAND_BLOCK: # PHP app nginx config server { listen 80; server_name {{ app.domain }}; root {{ app.path }}/public; location ~ \.php$ { fastcgi_pass unix:/run/php/php{{ app.php_version }}-fpm.sock; # ... } } COMMAND_BLOCK: curl -fsSL https://raw.githubusercontent.com/jhd3197/ServerKit/main/install.sh | bash Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: curl -fsSL https://raw.githubusercontent.com/jhd3197/ServerKit/main/install.sh | bash COMMAND_BLOCK: curl -fsSL https://raw.githubusercontent.com/jhd3197/ServerKit/main/install.sh | bash COMMAND_BLOCK: git clone https://github.com/jhd3197/ServerKit.git cd ServerKit docker compose up -d Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: git clone https://github.com/jhd3197/ServerKit.git cd ServerKit docker compose up -d COMMAND_BLOCK: git clone https://github.com/jhd3197/ServerKit.git cd ServerKit docker compose up -d - cPanel - $45/month per server. For 3 servers, that's $1,620/year just for a control panel. - Coolify - Great for Docker but felt like overkill for WordPress sites. I don't need Kubernetes. - CloudPanel - Nice and lightweight but no Docker support. I need both. - HestiaCP - Free and feature-rich but the UI looks like it's from 2008. - Deploy WordPress, Flask, Django, and Node.js apps - Manage Docker containers alongside traditional apps - Automatic HTTPS via Let's Encrypt - Real-time monitoring with alerts to Discord/Slack/Telegram - Visual firewall and cron job management - 2FA security with ClamAV malware scanning - Python 3.11 with Flask - SQLAlchemy ORM - Flask-SocketIO for real-time updates - Gunicorn for production - React 18 with Vite - WebSocket connection for live metrics - LESS for styling - Nginx reverse proxy - Let's Encrypt via Certbot - Docker & Docker Compose - MySQL/PostgreSQL support - WebSocket support (Flask-SocketIO is mature) - Template rendering for some pages - Simpler debugging during development - JWT with short expiration - TOTP 2FA with backup codes - All secrets encrypted at rest - No shell commands built from user input - Certbot for SSL (don't roll your own ACME) - ClamAV for malware (don't write an antivirus) - systemd for service management (it works)