Self-Hosting with Coolify: Ditch Vercel and Heroku Without the Pain
I spent years paying Forge £15/month to manage a server, plus the VPS cost on top. Before that, I paid Heroku ridiculous amounts for what amounted to a Docker container with a nicer UI. Then I found C
Self-Hosting with Coolify: Ditch Vercel and Heroku Without the Pain
I spent years paying Forge £15/month to manage a server, plus the VPS cost on top. Before that, I paid Heroku ridiculous amounts for what amounted to a Docker container with a nicer UI. Then I found Coolify and genuinely felt a bit stupid for not doing this sooner.
What Is Coolify?
Coolify is an open-source, self-hosted platform that gives you a Vercel/Heroku-like experience on your own server. You install it on a VPS, connect your Git repositories, and it handles:
- Building your application (Docker-based)
- Deploying with zero downtime
- SSL certificates (via Let's Encrypt, automatic)
- Reverse proxy configuration
- Environment variable management
- Database provisioning
- Log viewing
- Basic monitoring
It runs on any VPS: Hetzner, DigitalOcean, Vultr, OVH, wherever. You own the server, you own the data, and you pay only for the VPS itself.
The Cost Argument
Let me be concrete about what things cost.
PaaS pricing (approximate, 2026):
| Service | Price for a typical Laravel app |
|---|---|
| Heroku (Basic) | $25-50/month |
| Railway | $20-40/month |
| Render | $25-45/month |
| Laravel Forge + VPS | $12/month (Forge) + $5-20/month (VPS) |
| Vercel Pro | $20/month (but not suitable for Laravel) |
Self-hosted with Coolify:
| Component | Cost |
|---|---|
| VPS (Hetzner CX22 — 2 vCPU, 4GB RAM) | |
| Coolify | Free (open source) |
| Domain | ~£10/year |
| Total | ~£5/month |
For the Progress site, I'm running on a small Hetzner VPS. Total hosting cost: about £5/month. That includes the application, PostgreSQL database, Redis, queue workers, and the Coolify dashboard itself.
If you need more resources — say you've got 5 applications, a couple of databases, and queue workers — a bigger VPS at €8-15/month still costs less than a single Heroku app.
Setting Up Coolify
The actual setup process:
Step 1: Get a VPS
Any VPS provider works. I use Hetzner because they're cheap, reliable, and have data centres in the EU (useful for GDPR). You need at minimum 2 vCPU and 2GB RAM, but 4GB is more comfortable.
Step 2: Install Coolify
SSH into your server and run:
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
That's it. Seriously. It installs Docker, sets up Coolify, and gives you a URL to access the dashboard. The whole process takes about 5 minutes.
Step 3: Access the Dashboard
Navigate to http://your-server-ip:8000 in your browser. Create your admin account. You're in.
Step 4: Connect Your Git Repository
In the Coolify dashboard:
- Add a new project
- Select "Public Repository" or connect your GitHub account
- Paste your repository URL
- Select the branch to deploy from
- Coolify detects your Dockerfile automatically
Step 5: Configure Environment Variables
Add your .env variables through the Coolify UI. These are encrypted at rest and injected at runtime. Never committed to Git, never baked into images.
Step 6: Set Up Your Domain
In your DNS provider, add an A record pointing to your VPS IP. In Coolify, set the domain for your application. Coolify automatically provisions an SSL certificate via Let's Encrypt.
Step 7: Deploy
Click deploy, or push to your configured branch. Coolify builds the Docker image, runs it, and switches traffic over.
The Deployment Workflow
Once set up, the day-to-day workflow is:
- Write code locally
- Push to
main(or whatever branch you've configured) - Coolify webhook fires
- Coolify pulls the latest code
- Coolify builds a new Docker image
- Coolify starts the new container
- Coolify health-checks the new container
- Coolify switches traffic to the new container
- Old container is removed
This takes 2-4 minutes depending on whether dependencies have changed (Docker layer caching helps enormously).
Zero downtime. No SSH. No manual anything.
The Progress site uses exactly this workflow. I push to main, Coolify deploys, and 2-3 minutes later the changes are live. It's set up to trigger automatically on any push to main.
The laravel-coolify Package
I built a Laravel package specifically for Coolify integration. It provides:
- Health checks that Coolify can ping to verify your application is running correctly
- Deployment hooks to run post-deployment tasks (migrations, cache clearing, etc.)
- Configuration for Coolify-specific environment variables
// config/coolify.php
return [
'webhook_secret' => env('COOLIFY_WEBHOOK_SECRET'),
'health_check_path' => '/health',
];
The health check endpoint is particularly important. Coolify uses it to determine whether your new container is ready to receive traffic. If the health check fails, Coolify rolls back to the previous container. This prevents broken deployments from reaching users.
Database Management
Coolify can provision databases for you:
- PostgreSQL
- MySQL
- MariaDB
- MongoDB
- Redis
These run as Docker containers on the same VPS. For most applications, this is perfectly fine. You don't need a managed database service until you're handling serious traffic.
To provision a database:
- Go to your project in Coolify
- Add a new resource → Database
- Select PostgreSQL (or whatever)
- Set a password
- Coolify creates the container and gives you the connection details
- Add those details to your application's environment variables
Backups? Coolify supports automated database backups to S3-compatible storage. Set it up once and forget about it.
SSL and Domains
Coolify uses Traefik as a reverse proxy. It automatically:
- Routes traffic to the correct container based on domain name
- Provisions SSL certificates via Let's Encrypt
- Renews certificates before they expire
- Handles HTTP → HTTPS redirects
You configure the domain in Coolify's UI, point your DNS, and it just works. No Nginx configuration files. No certbot cron jobs.
Queue Workers and Scheduled Tasks
For Laravel apps, you need queue workers and the scheduler running. In your Dockerfile, use Supervisor to manage multiple processes:
[program:php-fpm]
command=php-fpm -F
autostart=true
autorestart=true
[program:queue-worker]
command=php /var/www/html/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
[program:scheduler]
command=/bin/sh -c "while true; do php /var/www/html/artisan schedule:run --no-interaction >> /dev/null 2>&1; sleep 60; done"
autostart=true
autorestart=true
Or, run separate containers for workers. Coolify supports multiple services per project, so you can have one container for the web server and another for queue workers sharing the same codebase.
When Self-Hosting Is Wrong
I'm not going to pretend self-hosting is always the right answer. Don't do it if:
You don't want any operational responsibility. If something goes wrong at 3am, it's your server. PaaS platforms handle this for you.
You need global edge deployment. If your users are spread across the world and need sub-50ms response times everywhere, you need a CDN-backed platform like Vercel or Cloudflare. A single VPS in Falkenstein won't cut it.
You're a startup with funding and no DevOps person. Your time is worth more than the hosting savings. Use Forge or Railway and focus on your product.
Compliance requires managed infrastructure. Some industries require SOC 2 compliant hosting, managed encryption, audit logs, etc. You can achieve this on a VPS, but it's more work.
Monitoring
Coolify gives you basic container logs and health status. For more detailed monitoring, I use:
- Application logs through Laravel's built-in logging (stored in the container, viewable through Coolify)
- Error tracking through a service like Sentry or Flare
- Uptime monitoring through a simple external service (UptimeRobot, Better Uptime)
This is not enterprise-grade observability. For most SaaS applications, especially early-stage ones, it's more than enough.
The Bottom Line
Self-hosting with Coolify gives you:
- 80-90% cost reduction compared to PaaS platforms
- Full control over your infrastructure
- PaaS-like developer experience (git push → deploy)
- No vendor lock-in (it's your VPS, move anywhere)
The trade-off is that you're responsible for the server. But with Coolify handling the deployment orchestration, SSL, and reverse proxying, the actual operational burden is minimal.
I've been running production applications on Coolify for a while now. The setup takes an afternoon. After that, it's push to deploy. If that sounds appealing — and if you're tired of paying £50/month for something you could host for £5 — give it a go.
I write about Laravel, AI tooling, and the realities of building software products. If you found this useful, there's more on stuartmason.co.uk.
Get the Friday email
What I shipped this week, what I learned, one useful thing.
No spam. Unsubscribe anytime. Privacy policy.