Virtualization

Self-Hosting a Heroku-Style PaaS on Your VPS with Coolify

Managed platforms like Heroku, Vercel, and Railway removed a lot of friction from shipping web applications, but they did it by abstracting the server away and charging for that convenience. If you already run a VPS, you can recover most of that developer experience yourself with Coolify, an open-source, self-hostable platform-as-a-service. It gives you a web dashboard that connects to a git repository, builds your application, runs it in a container, provisions a database, and terminates TLS automatically. This article walks through what Coolify is, how to install it, how to deploy an application and a database, how HTTPS and preview environments work, and where the tradeoffs against a managed provider actually land.

What Coolify is, and what runs under the hood

Coolify is a control plane for a single server or a fleet of servers. You point it at a machine over SSH, and it manages everything that runs there. It is not a new runtime or a proprietary format: under the hood it uses Docker to build and run your workloads, and a Traefik reverse proxy to route traffic and issue certificates. Your application ends up as an ordinary Docker container, and your database is a standard Postgres, MySQL, MongoDB, Redis, or similar image. That matters for portability. Nothing you deploy is locked to a Coolify-specific API, so if you ever move off it, you are moving standard containers.

The dashboard covers the parts you would otherwise script by hand: pulling from git, building an image, wiring environment variables, health checks, rolling deploys, log streaming, and scheduled backups. Coolify v4 is the current major line, and the project ships a catalogue of 280+ one-click services (databases, message queues, monitoring stacks, and self-hosted apps) alongside your own code.

Server requirements

Coolify installs Docker Engine 24+ during setup and expects to own the machine it runs on, so a fresh VPS is the cleanest starting point. The official minimum is 2 CPU cores, 2 GB of RAM, and 30 GB of disk. Coolify itself consumes roughly 600 MB of memory before you deploy anything, so in practice 4 GB of RAM gives your applications and databases room to breathe. This is the one place worth being plain about: Coolify wants a VPS with a few GB of RAM and root access, because it needs to install Docker and manage the proxy on your behalf.

Supported operating systems are broad: Debian-based (Debian, Ubuntu), RedHat-based (Fedora, AlmaLinux, Rocky, CentOS), SUSE, Arch, Alpine, and Raspberry Pi OS 64-bit. The automatic installer is smoothest on an LTS Ubuntu or Debian release.

One-line install

Log in to your server as root, or as a user with sudo, and run the official installer:

curl -fsSL https://cdn.coollabs.io/coolify/install.sh | sudo bash

The script installs Docker if it is missing, pulls the Coolify images, and starts the stack. It typically finishes in a few minutes. When it completes, open the dashboard in a browser:

http://YOUR_SERVER_IP:8000

The first account you create becomes the administrator, so register immediately rather than leaving the setup page exposed. Coolify treats the machine it runs on as the "localhost" server and can also manage additional remote servers over SSH; for those, your public key goes into the remote root user's ~/.ssh/authorized_keys.

Connecting a git repository

Deployments in Coolify start from source. You can connect a repository in two ways. The simplest is a public or private repository via a deploy key, where Coolify generates an SSH key you add to the repo. The more capable option is a GitHub App (or GitLab, Gitea, or Bitbucket integration), which grants Coolify webhook access so it can build automatically on every push and, importantly, react to pull requests.

Once a source is connected, you create a new resource, pick the repository and branch, and choose a build pack. Coolify can build from a Dockerfile, from Nixpacks or Buildpacks (which autodetect common stacks like Node, Python, Go, PHP, and Ruby), or from a docker-compose.yml if your app is multi-container. Environment variables are set in the dashboard and injected at build or runtime. From then on, a git push to the tracked branch triggers a build and a rolling deploy with no further action.

Deploying an application and a database

A typical small stack is a web application plus a database. Add the database first so its connection details exist when the app boots. In the dashboard, create a new database resource and choose an engine, for example PostgreSQL. Coolify starts the container, generates credentials, and gives you an internal hostname reachable by other resources in the same project over a private Docker network. You do not need to publish the database port to the public internet; keep it internal and reference it by service name.

Wire the application to the database through environment variables. A Postgres connection string in the app's environment usually looks like this, using the internal service name rather than a public IP:

DATABASE_URL=postgres://appuser:secret@my-postgres:5432/appdb

Trigger the first deploy from the dashboard, or push a commit. Coolify builds the image, starts the container, runs any configured health check, and switches traffic over once the container reports healthy. Logs stream live in the UI, and each deployment is recorded so you can roll back to a previous build if a release misbehaves.

Automatic HTTPS and preview environments

Add a domain to your application in the dashboard and point that domain's DNS A record at your server. Traefik then requests a certificate from Let's Encrypt automatically using the ACME HTTP-01 challenge over port 80, and once DNS resolves the certificate is usually issued within a minute or two. There is no certbot cron job to maintain; renewals are handled for you.

If you connected a git provider through its App integration, Coolify can build pull requests as separate preview deployments, each on its own subdomain, so reviewers can click a link and see the change running before it merges. Serving many short-lived preview subdomains over HTTPS works best with a wildcard certificate. Let's Encrypt only issues wildcards through the DNS-01 challenge, so this path requires configuring a DNS provider token in Coolify. With a wildcard in place, new preview URLs are reachable over HTTPS immediately instead of waiting on a fresh certificate per pull request.

Tradeoffs versus a managed platform

Self-hosting a PaaS trades a monthly bill and operational simplicity for control and cost predictability. It is worth being honest about both sides.

What you gain:

  • Flat, predictable cost. You pay for the VPS, not per-seat or per-build minutes, and Coolify itself is free and open source.
  • No vendor lock-in. Everything is standard Docker, so workloads are portable.
  • Full access. You can SSH in, inspect containers, tune the host, and run anything Docker can run.
  • Data residency. The database and its backups live on hardware you choose.

What you take on:

  • You are the operator. OS patching, host security, disk capacity, and the health of the Coolify server itself are your responsibility. A managed provider absorbs all of that.
  • Single-server failure. One VPS is a single point of failure. High availability means running and orchestrating multiple servers, which is more to manage than clicking a scale slider.
  • Backups are on you. Coolify can schedule database backups to S3-compatible storage, but you must configure and verify them.
  • No managed edge. There is no global CDN or anycast network out of the box the way some managed providers offer; you get one region unless you build more.

The honest summary: for a solo developer, a small team, internal tools, staging environments, or side projects, Coolify on a modest VPS delivers most of the Heroku experience at a fraction of the recurring cost. For workloads that genuinely need managed global distribution, hands-off high availability, or a team that cannot spare anyone to operate a server, a managed platform may still earn its price.

Wrap-up

Coolify turns a single VPS into a git-driven deployment platform with automatic TLS, database provisioning, and preview environments, all built on Docker and Traefik so nothing is proprietary. Installation is a single command, the resource footprint is modest, and the daily workflow is close to what managed PaaS users expect. The cost is operational ownership: you run the server. If that trade suits your team, it is one of the cleanest ways to self-host a Heroku-style experience. The official documentation at coolify.io/docs is the reference to keep open while you set it up.