Coolify Tutorial: Self-Host Like Heroku for Free
Deploy any app with Coolify, the open-source Heroku alternative. Complete setup guide with Docker and SSL.
Molted Team
molted.cloud
Deploy any app with Coolify, the open-source Heroku alternative. Complete setup guide with Docker and SSL.
Molted Team
molted.cloud
Heroku free tier died. Vercel bills stack up fast once you pass the hobby limits. Meanwhile, a $5/month VPS from Hetzner or DigitalOcean sits there with 2 CPUs and 4GB RAM, mostly idle. Coolify turns that VPS into your own Heroku-style platform, complete with Git deployments, SSL certificates, and database provisioning.
The pitch is simple: open-source, self-hosted, and genuinely free (besides server costs). You push code, Coolify builds and deploys it. No vendor lock-in, no surprise bills, and you own everything.
Coolify is a Platform-as-a-Service that runs on your own infrastructure. Under the hood, it manages Docker containers, handles reverse proxy configuration with Traefik, provisions SSL via Let's Encrypt, and gives you a clean UI to manage it all.
You connect your GitHub/GitLab repos, define build settings, and Coolify handles the rest. Push to main, your app rebuilds. Need a PostgreSQL database? Click a button. Redis? Same deal.
It competes with:
You need a few things before starting:
For this tutorial, I am using a Hetzner CX23 (2 vCPU, 4GB RAM, 40GB SSD) running Ubuntu 22.04. Total cost: around $4/month.
SSH into your server:
ssh root@your-server-ipRun the one-liner installer:
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bashThis installs Docker, Docker Compose, and Coolify itself. Takes 2-3 minutes depending on your server speed.
Once done, the script outputs your Coolify URL:
Coolify is ready! Open http://your-server-ip:8000Open that URL in your browser. Create your admin account on first visit. Use a strong password since this is your deployment dashboard.
Before deploying apps, point a domain (or subdomain) to your server. In your DNS provider:
A record: coolify.yourdomain.com → your-server-ip
A record: *.coolify.yourdomain.com → your-server-ip (wildcard for apps)The wildcard record lets Coolify auto-assign subdomains to your apps (like myapp.coolify.yourdomain.com).
In Coolify dashboard, go to Settings → Configuration and set your domain. Coolify will provision SSL certificates automatically.
Let's deploy a Next.js application.
Go to Sources → Add Source. Connect GitHub or GitLab with OAuth. Authorize Coolify to access your repositories.
Click "New Resource" → Application → Select your repo and branch.
Coolify auto-detects most frameworks. For Next.js, it sets:
npm run buildnpm run startSet the domain for your app. Either use a subdomain of your Coolify domain (myapp.coolify.yourdomain.com) or a completely separate domain.
Click Deploy. Coolify clones your repo, runs the build, creates a Docker container, configures Traefik routing, and provisions SSL. First deploy takes a few minutes; subsequent deploys are faster due to caching.
Watch the build logs in real-time. If something fails, the logs tell you exactly what went wrong.
Too much setup?
Molted handles your AI infrastructure. Deploy in clicks, not hours.
Coming soonMost apps need a database. Coolify provisions them as Docker containers.
New Resource → Database → PostgreSQL. Set a name and password. Click Create.
Coolify gives you the connection string:
postgresql://postgres:your-password@postgresql:5432/postgresAdd this as an environment variable in your app configuration:
DATABASE_URL=postgresql://postgres:your-password@your-db-name:5432/postgresThe internal Docker network handles DNS, so your app reaches the database by container name.
Same process: New Resource → Database → Redis. Connection string:
redis://default:your-password@your-redis-name:6379In your app settings, find the Environment Variables section. Add variables one by one or paste a .env file format:
DATABASE_URL=postgresql://...
REDIS_URL=redis://...
API_KEY=sk-your-secret-key
NODE_ENV=productionCoolify encrypts these at rest. They are injected into your container at runtime, never baked into the image.
For build-time secrets (like private npm tokens), use the Build Variables section instead.
Focus on building, not ops
24-hour free trial. No credit card.
Coolify handles SSL automatically via Let's Encrypt. When you add a domain to a resource, Coolify:
All traffic routes through Traefik, which terminates SSL and proxies to your containers. No nginx config files, no certbot cron jobs.
If certificate provisioning fails, check that your DNS is propagated (use dig your-domain.com) and that port 80/443 is open on your server.
Coolify can backup databases to S3-compatible storage (AWS S3, Backblaze B2, MinIO).
Go to your database settings → Backup. Configure:
Backups run as scheduled jobs. You can also trigger manual backups and download them directly.
Built-in monitoring is basic: container status, restart counts, and logs. For production workloads, consider adding:
Coolify has a one-click deploy for monitoring stacks in their service marketplace.
Coolify works great for small to medium workloads. However:
For hobby projects and early-stage startups, these limits rarely matter. As you grow, you might migrate to Kubernetes, managed services, or specialized hosting per workload type.
The beauty of Coolify: your apps are standard Docker containers. Migration means pointing your CI/CD elsewhere. No proprietary lock-in.
| Feature | Coolify | CapRover | Dokku |
|---|---|---|---|
| UI | Modern, polished | Functional, dated | CLI only |
| Git integration | Native OAuth | Webhook-based | Git push |
| Databases | One-click | One-click | Plugins |
| Active development | Very active | Slower | Active |
Coolify is the most user-friendly option for self-hosted PaaS in 2026. If you like the terminal, Dokku is rock-solid. CapRover still works but feels dated compared to Coolify.
Coolify turns a $5 VPS into a deployment platform that rivals Heroku's developer experience. Git push deploys, automatic SSL, one-click databases. The tradeoff is maintenance responsibility: you own the server, you fix the problems.
For web apps and APIs, this tradeoff usually makes sense. You save money and learn infrastructure skills. For specialized workloads like AI assistants, the calculus changes. Running OpenClaw reliably requires specific configurations, monitoring, and security considerations that go beyond typical web hosting.
Molted gives you production-ready AI hosting without the server management.
24-hour free trial · no credit card · cancel anytime
Run your personal AI assistant 24/7 on a Mac Mini. Complete setup guide for OpenClaw, formerly known as Clawdbot and MoltBot.
Run ChatGPT or Claude on WhatsApp with Baileys. Complete self-hosted setup guide with code examples and deployment options.
Run an AI assistant on Signal for encrypted conversations. Complete signal-cli setup with Claude integration.
ENCORE DEBOUT ?