Self-Hosted Development Infrastructure - Coolify & Hetzner Platform
Self-Hosted Coolify Infrastructure on Hetzner Cloud
Complete DevOps Platform for 250 SEK/Month
Built a production-ready self-hosted development infrastructure using Coolify on Hetzner Cloud – a powerful alternative to Vercel, Netlify, and Heroku that costs 80-90% less. This comprehensive Coolify setup guide shows how to deploy Docker containers, automate DevOps workflows, and manage multiple services (n8n, Grafana, MageAI, Appsmith) on a single VPS.
What you’ll learn:
- Complete Coolify installation and configuration on Hetzner
- Docker Compose deployment best practices
- Production hardening with monitoring, backups, and security
- Cost optimization strategies for self-hosted infrastructure
- Real-world lessons from managing 6+ production services
Why Choose Coolify on Hetzner? (vs. Vercel, Netlify, Heroku)
Traditional cloud development setups face significant obstacles:
- High costs for managed services across multiple platforms
- Vendor lock-in limiting flexibility and portability
- Complex deployment processes requiring extensive DevOps knowledge
- Limited control over infrastructure configuration and customization
- Scattered tooling across different providers and platforms
These challenges create both financial burden and operational complexity for development teams.
Technical Architecture
Coolify as Platform-as-a-Service
Coolify provides a self-hosted alternative to platforms like Vercel, Netlify, and Heroku:
HETZNER CLOUD
│
┌──────────────────────┼──────────────────────┐
│ │ │
VPS Server Load Balancer Storage
(Coolify Core) (Traefik Proxy) (Volumes)
│ │ │
└──────────────────────┼──────────────────────┘
│
▼
DOCKER CONTAINERS
│
┌─────────────────────────┼─────────────────────────┐
│ │ │
n8n MageAI Appsmith
(Automation) (Data Science) (Low-Code Platform)
│ │ │
└────────────────────────┼─────────────────────────┘
│
Grafana
(Monitoring)
│
Additional Services
Core Infrastructure Components
Hetzner Cloud Setup:
- High-performance VPS: 4GB RAM, 75GB disk (Ubuntu 22.04)
- Server IP: 46.62.206.47 with dedicated network configuration
- Automated backups and snapshot management
- European data centers ensuring GDPR compliance
- 4GB swap configured to prevent OOM issues
Coolify Platform Features:
- One-click Docker container deployment
- Automatic SSL certificate management via Let’s Encrypt
- Built-in reverse proxy with Traefik
- Git integration for continuous deployment
- Resource monitoring and logging
- Database management (PostgreSQL, MySQL, Redis)
Deployed Applications
n8n (Workflow Automation):
- Visual workflow automation platform
- API integrations and data processing pipelines
- Custom business process automation
- Slack, email, and webhook integrations
MageAI (Data Engineering):
- Modern data pipeline tool for ETL processes
- Interactive development environment
- Data transformation and orchestration
- Machine learning pipeline management
Appsmith (Low-Code Platform):
- Visual application development platform
- Custom business applications and dashboards
- Database integrations and API connections
- Rapid prototyping and internal tool creation
Grafana (Monitoring & Visualization):
- Real-time system monitoring and alerting
- Custom dashboards for infrastructure metrics
- Data visualization from multiple sources
- Performance tracking and log analysis
MinIO (Object Storage):
- S3-compatible object storage service
- Data lake storage for analytics pipelines
- Backup and archive management
- Integration with data processing tools
Crawlab (Web Scraping):
- Professional web scraping management platform
- Distributed scraping with MongoDB backend
- Scheduled data collection tasks
- Visual spider management interface
Implementation Strategy
Initial Setup Process
-
Hetzner Cloud Configuration
- Server provisioning with optimal specifications
- Network security and firewall configuration
- Domain setup and DNS management
- SSL certificate automation
-
Coolify Installation
- Docker environment preparation
- Coolify platform deployment
- Initial configuration and security hardening
- User access management setup
-
Application Deployment
- Docker Compose file preparation for each service
- Environment variable configuration
- Database setup and connection management
- Volume mapping for persistent data
Docker Compose Integration
Coolify’s strength lies in seamless Docker Compose deployment:
# Example n8n deployment configuration
version: '3.8'
services:
n8n:
image: docker.n8n.io/n8nio/n8n
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- N8N_HOST=${DOMAIN}
- N8N_PROTOCOL=https
volumes:
- n8n_data:/home/node/.n8n
networks:
- coolify
Cost Analysis
Monthly Infrastructure Costs (≈250 SEK)
Hetzner Cloud VPS:
- Server specifications: 4GB RAM, 75GB disk
- Monthly cost: ~200 SEK
- Network traffic included in base price
Additional Services:
- Domain registration and DNS: ~30 SEK
- Backup storage: ~20 SEK
- SSL certificates: Free (Let’s Encrypt)
Cost Comparison with Managed Services
Traditional managed services would cost significantly more:
- Vercel Pro: $20/month per project
- Heroku Standard: $25-50/month per application
- AWS/Azure equivalent: $100-300/month
Total savings: 80-90% reduction in infrastructure costs while gaining complete control.
Key Benefits
Operational Advantages
- Rapid Deployment: One-click container deployment from Docker Compose files
- Complete Control: Full access to server configuration and customization
- Unified Management: Single dashboard for all applications and services
- Automatic SSL: Let’s Encrypt integration for secure connections
- Git Integration: Continuous deployment from repository changes
Development Efficiency
- Local-to-Production Parity: Identical Docker environments across all stages
- Resource Monitoring: Built-in monitoring and logging capabilities
- Backup Management: Automated snapshots and data protection
- Scalability: Easy horizontal scaling with additional servers
- Team Collaboration: Shared access and environment management
Financial Impact
- Predictable Costs: Fixed monthly infrastructure expense
- No Usage Limits: Unlimited deployments and bandwidth within server capacity
- Resource Optimization: Efficient utilization of server resources
- Long-term Savings: Significant cost reduction compared to managed services
Lessons Learned
The ClickHouse Incident
An important learning experience during the project was the decommissioning of ClickHouse after it accumulated 57GB of profiling data, filling the entire disk and causing system failures. This incident highlighted several critical lessons:
Root Cause:
- ClickHouse profiling was enabled by default
- No disk space monitoring thresholds configured
- Profiling data grew exponentially without cleanup policies
Resolution:
- Emergency disk cleanup procedures implemented
- Service decommissioned in favor of lighter alternatives (PostgreSQL + TimescaleDB)
- Comprehensive disk monitoring alerts established
Preventive Measures Implemented:
- Docker log rotation configured (10MB × 3 files per container)
- Monthly cleanup automation via
docker-cleanup.sh - Disk usage alerts at 80% threshold
- Regular review of service resource consumption
This experience reinforced the importance of proactive monitoring and resource management in self-hosted infrastructure.
Technical Innovation
Infrastructure as Code
All configurations maintained as version-controlled code:
- Docker Compose files for each application
- Environment configuration templates
- Backup and deployment scripts
- Network and security configurations
Monitoring and Observability
Integrated monitoring stack providing:
- Application performance metrics
- Resource utilization tracking
- Log aggregation and analysis
- Uptime monitoring and alerting via UptimeRobot (5-minute intervals)
- Custom dashboard creation
Operational Automation
Custom operational tooling for infrastructure management:
Diagnostic Scripts:
quick-ssh.sh- Rapid health checks (disk, memory, Docker status)diagnose.sh- DNS resolution and HTTPS connectivity verificationdocker-cleanup.sh- Automated cleanup of unused Docker resources
Monitoring Setup:
- UptimeRobot external monitoring for all public endpoints
- Email/Slack alerting for service disruptions
- Automated health checks every 5 minutes
Emergency Recovery:
- Documented recovery procedures for server unresponsiveness
- Post-reboot recovery automation
- Disk space management and cleanup procedures
Scalability and Future Growth
Horizontal Scaling Options
- Multi-server Setup: Load balancing across multiple Hetzner instances
- Geographic Distribution: Servers in different regions for global availability
- Specialized Services: Dedicated servers for database or storage workloads
- High Availability: Redundant infrastructure for critical applications
Technology Expansion
Platform ready for additional tools and services:
- CI/CD Pipelines: Jenkins, GitLab runners, or GitHub Actions
- Database Services: PostgreSQL clusters, Redis, MongoDB
- Monitoring Stack: Grafana, Prometheus, Loki
- Development Tools: Code servers, testing environments
Results and Impact
This self-hosted infrastructure provides:
- 99.9% Uptime with reliable Hetzner infrastructure and UptimeRobot monitoring
- Sub-second Deployment times for new applications via Coolify
- Complete Data Ownership with no vendor dependencies
- Unlimited Scalability within server resource constraints
- Professional Development Environment at fraction of managed service costs
- 6+ Production Services running simultaneously on single VPS
- Automated Operations through custom scripts and monitoring
Technical Resources
The complete infrastructure setup is documented and available as open-source:
GitHub Repository: emilingemarkarlsson/tur-coolify-setup
Includes:
- Docker Compose configurations for all services
- Operational automation scripts
- Comprehensive troubleshooting guides
- Emergency recovery procedures
- Environment configuration templates
The platform successfully demonstrates that modern development infrastructure doesn’t require expensive managed services - with the right tools and setup, teams can achieve enterprise-grade capabilities while maintaining complete control and dramatically reducing costs.
Ready to Build Your Own Self-Hosted Infrastructure?
Get Started:
- Clone the complete Coolify setup repository
- Follow the Hetzner Cloud setup guide
- Deploy your first Docker container with Coolify
- Scale to production with monitoring and automation
Key Takeaways:
- ✅ Self-hosted Coolify provides enterprise features at 250 SEK/month
- ✅ Hetzner Cloud offers best price-performance for European hosting
- ✅ Docker Compose enables reproducible infrastructure as code
- ✅ DevOps automation saves hours of manual deployment work
- ✅ Complete control over your data and infrastructure
Tags: Coolify tutorial, Hetzner VPS, self-hosted PaaS, Docker deployment, DevOps infrastructure, cost-effective hosting, Coolify vs Vercel, self-hosted Heroku alternative
Interested in similar projects?
I help companies build modern data solutions and web applications. Let's discuss your next project!
Contact Me