A comprehensive terminal-based manager for Ubuntu 24.04 VPS that simplifies NGINX domain management and SSL certificate automation with Certbot integration.
- Interactive Terminal UI - Beautiful curses-based interface
- Domain Management - Add, edit, delete, and list domains
- SSL Automation - Automatic Let's Encrypt certificate generation
- Template System - Flexible NGINX configuration templates
- Backup & Restore - Comprehensive configuration backups
- Service Management - NGINX reload, restart, and status monitoring
- Log Viewer - Real-time log monitoring and analysis
- Modern SSL/TLS configurations
- Automatic certificate renewal
- Configuration validation
- Error handling and logging
- Safe backup and restore operations
- Intuitive navigation with arrow keys
- Confirmation dialogs for destructive operations
- Progress indicators for long-running tasks
- Comprehensive error messages
- Real-time status updates
- Ubuntu 24.04 VPS with root access
- Domain names pointing to your server's IP
- Ports 80 and 443 open in firewall
-
Automated Installation (recommended):
# Clone the repository git clone https://github.com/k6w/vps-manager.git cd vps-manager # Run the automated installer ./install.sh
-
Using pip:
# Clone the repository git clone https://github.com/k6w/vps-manager.git cd vps-manager # Install the package pip install -e .
-
Using Makefile:
# Clone the repository git clone https://github.com/k6w/vps-manager.git cd vps-manager # Install using make make install-full
-
Start the manager:
source activate_vps_manager.sh vps-manager
To completely remove VPS Manager from your system:
sudo vps-manager --uninstallThe uninstall process will:
- Remove all VPS Manager files and directories
- Stop and remove the systemd service
- Remove symbolic links
- Optionally delete SSL certificates (user choice)
- Optionally delete domain configurations (user choice)
Interactive prompts will ask you:
- Whether to delete SSL certificates (default: NO)
- Whether to delete domain configurations (default: NO)
Note: By default, your SSL certificates and domain configurations are preserved, allowing you to manage them manually or reinstall VPS Manager later without losing your setup.
Important: This VPS Manager creates individual configuration files for each domain in /etc/nginx/sites-available/ and /etc/nginx/sites-enabled/. It does NOT modify your main nginx.conf file. Each domain gets its own configuration file (e.g., managed-example.com.conf) that can be independently managed without affecting other sites or the main NGINX configuration.
╔══════════════════════════════════════╗
║ VPS Manager v2.0 ║
║ NGINX & SSL Manager ║
╠══════════════════════════════════════╣
║ 1. List Domains ║
║ 2. Add Domain ║
║ 3. Edit Domain ║
║ 4. Delete Domain ║
║ 5. NGINX Status ║
║ 6. Backup Configurations ║
║ 7. Restore Backup ║
║ 8. View Logs ║
║ 9. Exit ║
╚══════════════════════════════════════╝
- Select "Add Domain" from the main menu
- Enter your domain name (e.g.,
example.com) - Specify the backend port (e.g.,
3000for Node.js apps) - Choose SSL configuration (recommended: Yes)
- Select template (Default or Custom)
- Confirm and wait for automatic setup
The manager will automatically:
- Generate NGINX configuration
- Create SSL certificate via Certbot
- Enable the site
- Test and reload NGINX
- List Domains: View all configured domains with status
- Edit Domain: Modify domain settings (name, port, SSL)
- Delete Domain: Remove domain and clean up configurations
- Status Monitoring: Real-time NGINX service status
- Configuration Testing: Validate NGINX configs before applying
- Service Control: Reload, restart, or test NGINX
- Error Detection: Automatic configuration validation
- Automatic Backups: Created before major changes
- Manual Backups: On-demand full system backup
- Easy Restore: Select and restore from available backups
- Comprehensive Coverage: Includes configs, certificates, and logs
- HTTP to HTTPS redirection
- Modern SSL/TLS configuration
- Security headers (HSTS, CSP, etc.)
- Gzip compression
- Static file optimization
- Proxy pass configuration
- Access and error logging
Create custom NGINX configurations in ~/manager/custom-configs/:
# Example: API-specific template
server {
listen 443 ssl http2;
server_name $DOMAIN;
ssl_certificate $SSL_CERT_PATH;
ssl_certificate_key $SSL_KEY_PATH;
# API-specific settings
client_max_body_size 100M;
proxy_read_timeout 300s;
location /api/ {
proxy_pass http://127.0.0.1:$PORT/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}$DOMAIN- Domain name$PORT- Backend port$BACKEND_IP- Backend IP address (automatically detected VPS IP for Docker compatibility)$SSL_CERT_PATH- SSL certificate path$SSL_KEY_PATH- SSL private key path
vps-manager/
├── src/
│ └── vps_manager/
│ ├── __init__.py
│ ├── main.py # Entry point
│ ├── core.py # Core logic
│ ├── ui.py # User interface
│ └── utils.py # Utilities
├── tests/ # Unit tests
├── setup.py # Package configuration
├── Makefile # Build automation
├── requirements.txt # Dependencies
└── default.conf # Default NGINX template
# Runtime data (created during use):
~/manager/
├── domains.json # Domain configurations
├── custom-configs/ # Custom templates
├── backups/ # Configuration backups
└── logs/ # Application logs
# Start with specific configuration
vps-manager --config /path/to/config.json
# Enable debug mode
vps-manager --debug
# Run in batch mode (no UI)
vps-manager --batch --add-domain example.com --port 3000 --ssl
# Uninstall VPS Manager completely
sudo vps-manager --uninstall# Custom manager directory
export VPS_MANAGER_DIR="/opt/vps-manager"
# Custom NGINX directories
export NGINX_SITES_DIR="/etc/nginx/sites-available"
export NGINX_ENABLED_DIR="/etc/nginx/sites-enabled"1. Domain not accessible
# Check DNS
nslookup your-domain.com
# Check NGINX status
sudo systemctl status nginx
# Test configuration
sudo nginx -t2. SSL certificate errors
# Check Certbot logs
sudo tail -f /var/log/letsencrypt/letsencrypt.log
# Manual certificate generation
sudo certbot certonly --nginx -d your-domain.com3. Backend connection issues
# Check if backend is running
sudo netstat -tlnp | grep :3000
# Test backend directly
curl http://localhost:3000- Manager Logs:
~/manager/logs/manager.log - NGINX Error:
/var/log/nginx/error.log - NGINX Access:
/var/log/nginx/access.log - Certbot:
/var/log/letsencrypt/letsencrypt.log - System:
journalctl -u nginx
# Remove all manager configurations
sudo rm /etc/nginx/sites-enabled/managed-*
sudo rm /etc/nginx/sites-available/managed-*
sudo systemctl reload nginx
# Reset manager data
rm ~/manager/domains.json
rm ~/manager/config.json
# Clear manager logs
rm ~/manager/logs/manager.log- Keep Ubuntu updated:
sudo apt update && sudo apt upgrade - Configure UFW firewall:
sudo ufw enable - Use strong passwords and SSH keys
- Regular security audits
- Automatic certificate renewal enabled
- Modern cipher suites only
- HSTS headers configured
- Perfect Forward Secrecy
- Run with minimal privileges
- Validate all inputs
- Secure backup storage
- Regular log monitoring
# Add to custom templates for high-traffic sites
worker_processes auto;
worker_connections 1024;
# Enable caching
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}# Increase file descriptor limits
echo "* soft nofile 65536" >> /etc/security/limits.conf
echo "* hard nofile 65536" >> /etc/security/limits.conf
# Optimize kernel parameters
echo "net.core.somaxconn = 65536" >> /etc/sysctl.conf
sudo sysctl -p- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
# Clone repository
git clone https://github.com/k6w/vps-manager.git
cd vps-manager
# Install in development mode
pip install -e .[dev]
# Or use Makefile
make dev
# Run tests
make test
# or directly:
python -m unittest discover tests
# Run linting
make lint
# or directly:
flake8 src/- Documentation: DOCS.md
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with ❤️ for VPS administrators who value simplicity and reliability.