Deploy with Coolify: Turn Any VPS Into Your Own Heroku
Heroku killed its free tier. Vercel has limits. Railway bills surprise you. What if you could get the same push-to-deploy experience on a server you actually own? Coolify is an open-source platform-as-a-service that runs on your VPS. It handles SSL, reverse proxying, databases, and Git-based deployments—without the vendor lock-in. This guide shows you how to deploy with Coolify, from a bare server to a running application.
If you want to see Coolify in action with a specific app, check out our n8n Coolify Deployment: Self-Host Workflow Automation in 20 Minutes.
What You Will Build
By the end of this guide you will have:
- Coolify installed on a fresh VPS
- A domain pointing to your server with automatic SSL
- A project containing a deployed service from a Git repository
- Environment variables and persistent storage configured
- A working CI/CD pipeline that redeploys on every Git push
Prerequisites
Before you start, make sure you have:
- A fresh VPS (Ubuntu 22.04/24.04 LTS recommended) with at least 2 CPU cores, 2 GB RAM, and 30 GB disk
- Root or sudo SSH access to the server
- A domain name with DNS control (for SSL and subdomains)
- Basic familiarity with Docker, Git, and the command line
- Ports 22, 80, and 443 open in your firewall
Verify your server is ready:
ssh root@your-server-ip
uname -a
free -h
df -h
Update the system:
apt update && apt upgrade -y
Step 1: Install Coolify
Coolify provides an official install script that handles Docker, networking, and directory setup automatically.
Run the installer:
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | sudo bash
The script does the following:
- Installs Docker Engine 24+ and Docker Compose
- Creates directories under
/data/coolify - Generates SSH keys for server management
- Downloads and starts the Coolify stack
When finished, the script prints your Coolify URL:
Coolify is available at: http://your-server-ip:8000
Open that URL in a browser and create your admin account immediately. The registration page has no protection until the first user is created.
Step 2: Configure Your Domain and SSL
Coolify can run on an IP address, but production use demands a domain and HTTPS. Coolify uses Let's Encrypt automatically—no manual certificate management.
Set Up DNS
In your DNS provider, create these records:
Type: A
Name: coolify
Value: your-server-ip
Type: A
Name: *
Value: your-server-ip
The wildcard * record lets Coolify auto-create subdomains for every app you deploy. For example, deploying an app called api automatically gets api.yourdomain.com.
Add the Domain to Coolify
- In the Coolify dashboard, go to Settings → General
- Under Instance Domain, enter
coolify.yourdomain.com - Save and wait for Coolify to provision the certificate
If you use Cloudflare, disable the orange proxy cloud temporarily. Let's Encrypt needs direct access to your server for the HTTP-01 challenge.
Step 3: Create a Project and Deploy Your First App
Coolify organizes everything into projects. Each project contains resources—your applications, databases, and services.
Create a Project
- Click Projects in the sidebar, then Add New Project
- Name it
production - Select the server you just set up
Add a Resource from Git
- Inside the project, click Add New Resource
- Select Public Repository (or Private if you have a GitHub/GitLab token)
- Enter your repository URL, e.g.,
https://github.com/yourname/your-app - Select the branch (usually
main) - Coolify auto-detects the buildpack based on your files (Dockerfile, package.json, etc.)
If your repo has a Dockerfile, Coolify uses it directly. If not, it falls back to Nixpacks or Heroku buildpacks.
Configure Environment Variables
Before deploying, set your environment variables:
- Go to the Environment Variables tab in your resource
- Add keys like
NODE_ENV=production,DATABASE_URL,API_KEY - Coolify injects these into the container at runtime
Click Deploy. Coolify pulls the code, builds the image, and starts the container.
Step 4: Add a Database
Most apps need a database. Coolify can provision PostgreSQL, MySQL, Redis, MongoDB, and more as managed services.
- In your project, click Add New Resource
- Select PostgreSQL (or your preferred database)
- Coolify creates the container and generates credentials automatically
View the connection details:
Host: postgresql-container-name
Port: 5432
Database: postgres
Username: coolify
Password: auto-generated
Copy these into your app's environment variables. Because both containers run on the same Docker network, they can reach each other by container name.
Step 5: Configure Persistent Storage
Containers are ephemeral. If your app writes files—uploads, logs, caches—you need persistent storage.
- In your resource settings, go to Storage
- Click Add New Storage
- Set the container path, e.g.,
/app/data - Coolify creates a host volume and mounts it automatically
For example, if you run a file upload service:
Container path: /app/uploads
Host path: /data/coolify/applications/your-app/uploads
Files written to /app/uploads inside the container persist on the host disk across redeploys.
Step 6: Enable Auto-Deploy from Git
The real power of Coolify is automatic redeployment. Push to Git, and Coolify rebuilds and deploys.
Configure a GitHub Webhook
- In your resource settings, go to Webhooks
- Copy the webhook URL (e.g.,
https://coolify.yourdomain.com/webhooks/github/...) - In your GitHub repository, go to Settings → Webhooks → Add webhook
- Paste the URL, set content type to
application/json, and select Just the push event
Now every git push triggers a new build in Coolify. No manual deploys, no SSH sessions.
For a concrete example of this workflow with n8n, see n8n Coolify Deployment: Self-Host Workflow Automation Without the DevOps Headache.
Tips and Troubleshooting
SSL certificate fails to provision
- Verify DNS A records point to your server IP with
dig yourdomain.com +short - Ensure port 80 is open for the Let's Encrypt HTTP-01 challenge
- If using Cloudflare, disable the proxy (grey cloud) until the certificate is issued
Build fails with "out of memory"
- Coolify builds images on the server. Large builds need RAM
- Add swap space as a temporary buffer:
fallocate -l 2G /swapfile chmod 600 /swapfile mkswap /swapfile swapon /swapfile
App shows 502 Bad Gateway
- The container may have crashed or failed to start. Check the resource logs in Coolify
- Verify the app is listening on the correct port (usually 3000, 8080, or 80)
- Ensure the health check path returns a 200 status
Database connection refused
- Confirm the database container is running in the same project
- Use the container name as the host, not
localhostor127.0.0.1 - Check that the database password in your environment variables matches
Webhook not triggering deploys
- Verify the webhook URL is reachable from the internet
- Check the webhook payload format matches what Coolify expects
- Test manually with curl:
curl -X POST https://coolify.yourdomain.com/webhooks/github/your-token \ -H "Content-Type: application/json" \ -d '{"ref":"refs/heads/main"}'
Server becomes unresponsive during builds
- Monitor resource usage with
htopordocker stats - Consider separating the build server from the production server, or upgrading your VPS
Next Steps
You now know how to deploy with Coolify on your own VPS. You have a working PaaS with SSL, databases, persistent storage, and Git-based auto-deployment. That is a powerful foundation. From here, consider:
- Adding multiple servers to Coolify for distributed deployments
- Setting up preview environments for every pull request
- Using Coolify's service catalog to deploy n8n, Plausible, Uptime Kuma, and more
- Configuring backup schedules for your databases and volumes
- Integrating Coolify with your CI/CD pipeline for advanced deployment strategies
Self-hosting does not have to mean manual server administration. With Coolify, you get the convenience of a managed platform and the freedom of owning your infrastructure.
For another real-world Coolify deployment example, read Deploy n8n on Coolify: Self-Hosted Workflow Automation Without the SaaS Bill.
Need Help Scaling This?
If you are running production workloads and need multi-server orchestration, custom build pipelines, database clustering, or migration from Heroku / Vercel / Railway, we can help. Contact the Sysbrix team and we will architect a self-hosted platform that fits your team.