Technology Encyclopedia Home >How to Deploy Coolify — Self-Hosted PaaS on a VPS

How to Deploy Coolify — Self-Hosted PaaS on a VPS

At a certain point I had enough apps on my servers that managing deployments manually — git pull, npm install, restart PM2, check logs — was taking real time every week. I wanted a deployment experience where I push to a branch and the app updates automatically, without setting up GitHub Actions for each project individually.

Coolify is that experience on your own server. You give it access to a GitHub repository, tell it what kind of app it is, and it handles the build, deployment, SSL certificate, and process management. Push to main, and the app updates.

The trade-off: Coolify wants to manage Docker and its own Nginx proxy, which can conflict with existing setups. This guide covers that conflict explicitly.

This guide installs Coolify on Ubuntu 22.04 and walks through deploying your first application from GitHub.

I run Coolify on Tencent Cloud Lighthouse. The 2 vCPU / 4 GB RAM plan works for personal projects; the 4 vCPU / 8 GB RAM plan gives more headroom when running several applications simultaneously. Lighthouse is a good fit for Coolify because of the spec upgrade path — you can start small and upgrade as your portfolio of deployed apps grows, without re-provisioning. The snapshot feature also provides a safety net before major Coolify version updates, which occasionally have database migration steps.


Table of Contents

  1. What Coolify Does
  2. Prerequisites
  3. Part 1 — Install Coolify
  4. Part 2 — Initial Setup
  5. Part 3 — Connect a Server
  6. Part 4 — Deploy Your First Application from GitHub
  7. Part 5 — Deploy a Database
  8. Part 6 — Connect a Domain and Enable HTTPS
  9. Part 7 — Set Environment Variables
  10. Part 8 — Monitor Deployments
  11. The Gotcha: Coolify vs Docker Compose Coexistence
  12. Common Coolify Operations

  • Key Takeaways
  • Use the appropriate Lighthouse application image to skip manual installation steps where available
  • Lighthouse snapshots provide one-click full-server backup before major changes
  • OrcaTerm browser terminal lets you manage the server from any device
  • CBS cloud disk expansion handles growing storage needs without server migration
  • Console-level firewall + UFW = two independent protection layers

What Coolify Does {#what}

Feature What it means
Git-based deployments Connect a GitHub/GitLab/Gitea repo → auto-deploy on push
Docker-based Every app runs in Docker containers
Automatic SSL Let's Encrypt certificates provisioned automatically
Database management Deploy MySQL, PostgreSQL, Redis, MongoDB in one click
Environment variables Managed secrets injected at runtime
Logs and metrics Real-time logs and resource usage per application
Rollback Return to any previous deployment
Multi-server Manage apps across multiple servers from one UI

Prerequisites {#prerequisites}

Requirement Notes
Cloud server Tencent Cloud Lighthouse Ubuntu 22.04
4 GB+ RAM Coolify itself uses ~1 GB; leave room for apps
Domain name For accessing the Coolify UI and deployed apps
GitHub account For deploying apps from git repos

Part 1 — Install Coolify {#part-1}

Coolify provides an official installation script:

ssh ubuntu@YOUR_SERVER_IP

# Install Coolify
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash

The script installs Docker, configures networking, and starts all Coolify services. This takes 3-5 minutes.

After installation:

# Check Coolify is running
sudo docker ps | grep coolify

# Coolify UI runs on port 8000
curl -I http://localhost:8000

Part 2 — Initial Setup {#part-2}

Coolify's web interface runs on port 8000. Access it temporarily via http://YOUR_SERVER_IP:8000 to complete setup.

Open port 8000 temporarily:

sudo ufw allow 8000/tcp

Visit http://YOUR_SERVER_IP:8000.

  1. Create your admin account — email and password
  2. Optional: Configure email for notifications
  3. Set your instance URL (the domain where Coolify's UI will be accessible)

After initial setup, close port 8000 and access Coolify via your domain with HTTPS (Coolify can generate its own SSL certificate for the UI domain).

sudo ufw delete allow 8000/tcp

Part 3 — Connect a Server {#part-3}

Coolify can deploy to:

  • Localhost — the same server where Coolify is installed (simplest)
  • Remote servers — via SSH (manage multiple servers from one Coolify UI)

For localhost deployment:

  1. Servers → Add a New Server
  2. Select Localhost
  3. Click Validate Server — Coolify verifies Docker is running

For remote servers:

  1. Servers → Add a New Server → Remote Server
  2. Enter the server IP, SSH user, and private key
  3. Click Validate Server

Part 4 — Deploy Your First Application from GitHub {#part-4}

Connect GitHub

  1. Settings → Source: GitHubRegister New GitHub App
  2. Follow the OAuth flow to authorize Coolify
  3. Install the GitHub App on your repositories

Create a new project and deployment

  1. Projects → + New Project → + New Resource → Application
  2. Select your connected GitHub account
  3. Choose the repository and branch
  4. Coolify auto-detects the application type (Node.js, Python, PHP, etc.)

Build configuration

For a Node.js app:

Build Pack: Nixpacks (auto-detect) or Dockerfile
Build Command: npm install && npm run build
Start Command: npm start
Port: 3000

For a Python Flask app:

Build Pack: Nixpacks
Start Command: gunicorn app:app
Port: 5000

Coolify uses Nixpacks — a build tool that auto-detects your language and creates an optimized Docker image without a Dockerfile.

  1. Click Deploy

Coolify pulls the code, builds the Docker image, and starts the container. Watch the deployment log in real-time.


Part 5 — Deploy a Database {#part-5}

  1. Projects → your project → + New Resource → Database
  2. Choose the database type: PostgreSQL, MySQL, MariaDB, MongoDB, Redis
  3. Configure:
    • Database name
    • Username and password (auto-generated if left blank)
    • Version
  4. Click Deploy

The database is accessible from your application via the internal Docker hostname that Coolify provides.

Connect your app to the database

After deploying the database, Coolify shows connection details. Add them to your application's environment variables:

DATABASE_URL=postgresql://user:password@INTERNAL_DB_HOST:5432/mydb

Part 6 — Connect a Domain and Enable HTTPS {#part-6}

  1. In your application settings → Domains
  2. Add your domain: myapp.yourdomain.com
  3. Enable HTTPS (Coolify handles Let's Encrypt automatically)
  4. Click Save

Point your domain's DNS A record to your server IP. Coolify will provision the SSL certificate on the next deployment or when you click Force Deploy.


Part 7 — Set Environment Variables {#part-7}

  1. Application settings → Environment Variables
  2. Add key-value pairs:
    NODE_ENV = production
    JWT_SECRET = your-secret-here
    DATABASE_URL = postgresql://...
    
  3. Click Save and Redeploy

Environment variables are injected into the container at runtime. They're encrypted at rest in Coolify.

For shared secrets across applications, use Shared Variables under Settings.


Part 8 — Monitor Deployments {#part-8}

Real-time logs

Click on a running application → Logs. See container output in real-time.

Resource usage

Application → Metrics — CPU and memory usage graphs.

Deployment history

Application → Deployments — list of all deployments with status, duration, and git commit. Click any deployment to view its build log.

Rollback

If a deployment breaks something:

  1. Deployments → click the previous working deployment
  2. Rollback to this deployment

Coolify re-deploys the container with the previous commit's image.


The Gotcha: Coolify vs Docker Compose Coexistence {#gotcha}

Coolify takes over Docker networking and may conflict with Docker Compose stacks you deployed manually before installing Coolify. Symptoms:

  • Nginx proxy conflicts (Coolify uses its own Caddy/Traefik reverse proxy)
  • Port conflicts on 80/443

If you have existing Docker Compose deployments:

Option A: Migrate everything to Coolify — deploy each stack through Coolify's UI.

Option B: Run Coolify on a different server — dedicate one server to Coolify-managed apps and keep your manually managed stacks on another.

Option C: Use Coolify alongside Compose on different ports — run Coolify's proxy on non-standard ports and put a system Nginx in front. This requires advanced configuration.

The simplest approach: install Coolify on a fresh server without existing Docker Compose stacks.


Common Coolify Operations {#operations}

# Check Coolify service status
sudo docker ps --filter name=coolify
sudo docker compose -f /data/coolify/source/docker-compose.yml logs -f

# Update Coolify
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
# Or from the UI: Settings → Updates → Update to Latest

# Restart Coolify
cd /data/coolify/source
sudo docker compose restart

# View Coolify database
sudo docker exec -it coolify-db psql -U coolify coolify

# Backup Coolify data
sudo tar czf coolify_backup_$(date +%Y%m%d).tar.gz /data/coolify

Troubleshooting {#troubleshooting}

Issue Likely Cause Fix
Connection refused Service not running or wrong port Check systemctl status SERVICE and verify firewall rules
Permission denied Wrong file ownership or permissions Check file ownership with ls -la and use chown/chmod to fix
502 Bad Gateway Backend service not running Restart the backend service; check logs with journalctl -u SERVICE
SSL certificate error Certificate expired or domain mismatch Run sudo certbot renew and verify domain DNS points to server IP
Service not starting Config error or missing dependency Check logs with journalctl -u SERVICE -n 50 for specific error
Out of disk space Logs or data accumulation Run df -h to identify usage; clean logs or attach CBS storage
High memory usage Too many processes or memory leak Check with htop; consider upgrading instance plan if consistently high
Firewall blocking traffic Port not open in UFW or Lighthouse console Open port in Lighthouse console firewall AND sudo ufw allow PORT

Frequently Asked Questions {#faq}

When should I use Coolify instead of managing Docker directly?
Use Coolify when you want a visual management layer on top of Docker, simplified deployment workflows, or to manage Docker for users who aren't familiar with the CLI.

Is Coolify suitable for production use?
For small to medium deployments, yes. Large-scale production typically uses orchestration platforms like Kubernetes. Coolify is well-suited for individual developers, small teams, and homelab environments.

How do I back up container data?
Back up named volumes (where persistent data lives), not containers themselves. The guide covers volume backup strategies and how to combine application-level backups with Lighthouse snapshots.

What happens if I need to migrate to a different server?
Export your Docker volumes and compose files, provision a new Lighthouse instance with Docker CE image, and restore the data. Container-based deployments are designed to be portable.

How do I monitor container resource usage?
Use docker stats for real-time monitoring, or deploy Netdata or Prometheus + Grafana for historical metrics and alerts. Portainer's web interface also shows per-container resource usage.

Deploy your own PaaS today:
👉 Tencent Cloud Lighthouse — Ubuntu VPS for self-hosted infrastructure
👉 View current pricing and promotions
👉 Explore all active deals and offers