A production-ready VPS platform template for Ubuntu 24.04 built with Docker, security hardening, monitoring, and GitHub Actions CI/CD.
Transform your fresh VPS into a structured, reusable platform with reverse proxy, HTTPS, databases, caching, application deployment, backup workflows, and comprehensive monitoring.
- Features
- Quick Start
- Architecture
- Platform Components
- Documentation
- CLI Reference
- Configuration
- Contributing
- License
- Docker Engine with Docker Compose plugin
- UFW Firewall with sensible defaults
- Fail2Ban for brute-force protection
- Deploy User with sudo and Docker access
- PostgreSQL with backups
- MySQL/MariaDB with backups
- Redis with persistence
- SQL Server (optional)
- Generic App Template with Docker
- Environment-aware Deploy Scripts
- Health Checks & Rollback support
- Migration Hooks
- CI/CD-ready layout
- SSH Hardening templates
- WAF with ModSecurity + OWASP CRS
- Fail2Ban jail templates
- Security Audit scripts
- Port Review helpers
- Netdata for real-time monitoring
- Uptime Kuma for uptime tracking
- Prometheus + Grafana stack
- SSL Expiration monitoring
- Disk & Container checks
- vps-cli - Central CLI tool
- Service Registry - Track deployed services
- Config Validation - Check configuration
- Backup Verification - Verify backup integrity
- Ubuntu 24.04 LTS (or 22.04 LTS)
- Fresh VPS or VM
- Root or sudo access
- Git
git clone https://github.com/yourusername/vps-starter-kit.git
cd vps-starter-kit
chmod +x install.sh vps-cli
sudo ./install.shsudo BOOTSTRAP_USER=deployer \
VPS_ROOT=/opt/vps \
INSTALL_NPM=yes \
AUTO_START_NPM=yes \
ENABLE_UFW=yes \
ENABLE_FAIL2BAN=yes \
TZ_VALUE=Asia/Ho_Chi_Minh \
./install.sh# Login as deploy user
sudo su - deployer
# Check platform status
cd /opt/vps && ./vps-cli status
# Start services
cd /opt/vps/vps-infra/nginx-proxy-manager && docker compose up -d
# Access Nginx Proxy Manager
# URL: http://your-vps-ip:81
# Default: admin@example.com / changemeβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β VPS STARTER KIT β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β SECURITY LAYER β β
β β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β β
β β β WAF β βFail2Banβ β SSH β β Audit β β β
β β βModSec β β β βHardeningβ β β β β
β β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β INFRASTRUCTURE LAYER β β
β β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β β
β β β NPM β β Nginx β β Redis β β Network β β β
β β β Proxy β β Proxy β β Cache β β Segmentsβ β β
β β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β DATA LAYER β β
β β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β β
β β βPostgres β β MySQL β β Redis β βBackups β β β
β β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β MONITORING LAYER β β
β β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β β
β β βNetdata β βPrometheusβ β Grafana β β Uptime β β β
β β β β β β β β β Kuma β β β
β β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β PLATFORM LAYER β β
β β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β β
β β βvps-cli β βRegistry β β Deploy β β Secrets β β β
β β β β β β β Scripts β β β β β
β β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Directory | Description |
|---|---|
vps-app/ |
Generic application template |
vps-db/ |
Database containers (PostgreSQL, MySQL, Redis) |
vps-infra/ |
Infrastructure (Nginx Proxy Manager, shared scripts) |
vps-monitoring/ |
Monitoring stack (Netdata, Prometheus, Grafana) |
vps-security/ |
Security hardening (WAF, Fail2Ban, SSH) |
vps-secrets/ |
Secrets management templates |
vps-alerting/ |
Alert configurations |
vps-platform/ |
Platform automation scripts |
vps-vpn/ |
WireGuard VPN server |
plugins/ |
Optional plugins (MinIO, Kafka, Elasticsearch) |
docs/ |
Documentation |
config/ |
Platform configuration |
| Service | Port | Description |
|---|---|---|
| HTTP | 80 | HTTP traffic |
| HTTPS | 443 | HTTPS traffic |
| NPM Admin | 81 | Nginx Proxy Manager UI |
| WireGuard | 51820 | VPN |
| WireGuard UI | 51821 | VPN Web UI |
# Status & Info
./vps-cli status # Show platform status
./vps-cli show-config # Display configuration
./vps-cli validate-config # Validate config files
./vps-cli list-services # List all services
# Health Checks
./vps-cli check-containers # Check container health
./vps-cli check-disk # Check disk usage
./vps-cli check-endpoints # Check HTTP endpoints
./vps-cli check-ssl # Check SSL expiration
# Backup & Recovery
./vps-cli backup-all # Run all backups
./vps-cli verify-backups # Verify backup integrity
# Maintenance
./vps-cli cleanup # Clean up old containers/images
./vps-cli audit-security # Run security audit# Application Management
/opt/vps/scripts/create-app.sh # Create new application
/opt/vps/scripts/register-project.sh # Register project
/opt/vps/scripts/register-service.sh # Register service
# Database
/opt/vps/scripts/backup-db.sh # Backup databases
/opt/vps/scripts/restore-db.sh # Restore database
# Monitoring
/opt/vps/scripts/check-ssl.sh # Check SSL certificates
/opt/vps/scripts/check-endpoints.sh # Check endpoints| Variable | Default | Description |
|---|---|---|
BOOTSTRAP_USER |
deployer |
Deploy user name |
VPS_ROOT |
/opt/vps |
Platform root directory |
INSTALL_NPM |
yes |
Install Nginx Proxy Manager |
AUTO_START_NPM |
yes |
Start NPM after install |
ENABLE_UFW |
yes |
Enable UFW firewall |
ENABLE_FAIL2BAN |
yes |
Enable Fail2Ban |
TZ_VALUE |
UTC |
Timezone |
PROXY_NETWORK |
proxy_network |
Docker proxy network |
DB_NETWORK |
db_network |
Docker database network |
# Edit platform config
nano /opt/vps/config/platform.yml
# View current config
./vps-cli show-config# 1. Create application from template
cd /opt/vps
./scripts/create-app.sh --name myapp --path /opt/myapp
# 2. Configure environment
cd /opt/myapp
cp .env.production.example .env
nano .env
# 3. Deploy
./scripts/deploy.sh --env production --backup
# 4. Access via Nginx Proxy Manager
# Add proxy host pointing to myapp:3000# Backup all databases
cd /opt/vps
./scripts/backup-db.sh all
# Backup specific database
./scripts/backup-db.sh postgres
# List backups
ls -la /opt/vps/backups/# Check all SSL certificates
./vps-cli check-ssl
# Check specific domain
./vps-cli check-ssl example.com- Change default passwords for Nginx Proxy Manager
- Configure SSH keys for deploy user
- Review firewall rules with
ufw status - Set up Fail2Ban notifications
- Enable SSL for all services
- Review security audit with
./vps-cli audit-security
- Use strong passwords and SSH keys
- Enable 2FA where possible
- Regularly update system packages
- Monitor logs for suspicious activity
- Test backup restoration procedures
vps-starter-kit/
βββ install.sh # Bootstrap script
βββ vps-cli # CLI tool
βββ README.md # This file
βββ CHANGELOG.md # Version history
βββ config/
β βββ platform.yml # Platform config
β βββ README.md
βββ vps-app/
β βββ app-template/ # App template
βββ vps-db/
β βββ postgres/
β βββ mysql/
β βββ redis/
β βββ sqlserver/
βββ vps-infra/
β βββ nginx-proxy-manager/
β βββ shared/
β βββ scripts/
βββ vps-monitoring/
β βββ netdata/
β βββ prometheus-grafana/
β βββ uptime-kuma/
βββ vps-security/
β βββ ssh/
β βββ fail2ban/
β βββ waf/
β βββ audit/
βββ vps-secrets/
β βββ scripts/
βββ vps-alerting/
βββ vps-platform/
β βββ scripts/
β βββ registry/
βββ vps-vpn/
β βββ wireguard/
βββ plugins/
β βββ minio/
β βββ kafka/
β βββ elasticsearch/
βββ docs/
βββ OPERATIONS.md
βββ SECURITY.md
βββ BACKUP_AND_RESTORE.md
βββ DISASTER_RECOVERY.md
βββ MONITORING.md
βββ CICD_V3.md
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Docker and the Docker Compose community
- Nginx Proxy Manager team
- OWASP for the Core Rule Set
- All contributors and maintainers
Made with β€οΈ for the self-hosted community