DEV Community

Cover image for How to Self-Host Coolify on Your VPS: A Complete Guide
Jaskaran Deogan
Jaskaran Deogan

Posted on • Edited on

How to Self-Host Coolify on Your VPS: A Complete Guide

Deploying applications can be a complex process, especially if you're managing multiple projects. Coolify offers a streamlined solution for developers who want control without the complexity. In this guide, I'll walk you through what Coolify is and how to set it up on your own VPS.

What is Coolify?

Coolify is an open-source, self-hostable alternative to platforms like Heroku and Netlify. It's designed to simplify the deployment and management of applications, websites, and databases on your own infrastructure. With Coolify, you can deploy applications directly from Git repositories with just a few clicks.

Why Use Coolify?

  1. Complete Control: You own your infrastructure and data
  2. Cost-Effective: Eliminate ongoing SaaS subscription fees
  3. Privacy: Your code and data stay on your servers
  4. Customization: Configure everything to your exact needs
  5. One-Click Deployments: Deploy applications straight from your Git repositories
  6. Multiple Application Support: Host various applications, websites, and databases in one place

Prerequisites

Before installing Coolify, ensure your VPS meets these requirements:

  • At least 2 CPU cores
  • Minimum 4 GB RAM
  • 40 GB storage
  • Ubuntu 20.04 or newer (Ubuntu 24.04 recommended)
  • Root or sudo access
  • SSH access
  • Internet connection
  • Basic understanding of Docker

Step-by-Step Installation Guide

Step 1: Connect to Your VPS

Connect to your server via SSH:

ssh root@your_server_ip
Enter fullscreen mode Exit fullscreen mode

Step 2: Update Your System

Always start with a fully updated system:

apt update && apt upgrade -y
Enter fullscreen mode Exit fullscreen mode

Step 3: Verify Docker Installation

Coolify requires Docker and Docker Compose. Check if Docker is already installed:

docker --version
Enter fullscreen mode Exit fullscreen mode

If Docker isn't installed, follow the official Docker installation guide for your Ubuntu version from the Docker documentation.

Step 4: Install Coolify

The simplest way to install Coolify is using the official installation script:

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

Step 5: Access Coolify Dashboard

successful installation

After installation completes successfully, the script will display your Coolify URL (typically http://your_server_ip:8000).
To access your dashboard:

  • Visit this URL in your web browser
  • You'll be redirected to a registration page
  • Create your first admin account immediately

Making Coolify Publicly Accessible

By default, Coolify might only be accessible locally. Let's configure it for public access.

Step 1: Configure Firewall Rules

First, check your firewall status:

sudo ufw status
Enter fullscreen mode Exit fullscreen mode

If UFW isn't installed:

sudo apt install ufw
Enter fullscreen mode Exit fullscreen mode
# Allow SSH
sudo ufw allow ssh

# Allow Coolify main port
sudo ufw allow 8000/tcp

# Allow HTTP and HTTPS for deployed applications
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

# Enable the firewall
sudo ufw enable
Enter fullscreen mode Exit fullscreen mode

Step 2: Verify Port Binding

Ensure Coolify is listening on all interfaces:

sudo netstat -tulpn | grep 8000
Enter fullscreen mode Exit fullscreen mode

You should see it bound to 0.0.0.0:8000 rather than just 127.0.0.1:8000.

Step 3: Restart Coolify

After making changes, restart Coolify:

cd /data/coolify/source
docker compose down
docker compose up -d
Enter fullscreen mode Exit fullscreen mode

Step 4: Test External Access

Now try accessing Coolify from outside your server:

http://your-server-ip:8000
Enter fullscreen mode Exit fullscreen mode

Coolify Dashboard

If you don't know your server's public IP address, use:

curl -4 icanhazip.com
Enter fullscreen mode Exit fullscreen mode

Setting Up a Custom Domain for Your Coolify Dashboard

For a more professional setup, you can configure Coolify to use your own domain.

Step 1: Add DNS Record

First, add an A record at your domain registrar:

  • Type: A
  • Name: coolify (or subdomain of your choice, or @ for root domain)
  • Value: Your server's IP address

Step 2: Update Coolify Configuration
Modify Coolify's environment variables:

cd /data/coolify/source

# Backup existing environment file
cp .env .env.backup

# Edit the .env file
nano .env
Enter fullscreen mode Exit fullscreen mode

Add or update these variables:

APP_URL=https://yourdomain.com
COOLIFY_FQDN=yourdomain.com
Enter fullscreen mode Exit fullscreen mode

Step 3: Restart Coolify with New Configuration

cd /data/coolify/source

# Stop everything
docker compose --env-file .env -f docker-compose.yml -f docker-compose.prod.yml stop

# Start everything fresh
docker compose --env-file .env -f docker-compose.yml -f docker-compose.prod.yml up -d

Enter fullscreen mode Exit fullscreen mode

Coolify should now be accessible via your custom domain!

Verifying Your Installation

To ensure everything is running properly:

1. Check Container Status:

docker ps
Enter fullscreen mode Exit fullscreen mode

Look for Coolify-related containers running without errors.

2. Check Logs:

cd /data/coolify/source
docker compose logs
Enter fullscreen mode Exit fullscreen mode

3. Test Dashboard Access:

Visit your dashboard URL (either IP:8000 or your custom domain) in a browser.

Conclusion

Coolify provides a powerful, self-hosted platform for managing your applications. By following this guide, you've successfully set up your own deployment platform that gives you complete control over your infrastructure.

With Coolify up and running, you can now deploy websites, applications, and databases with ease—all from a clean, user-friendly dashboard that you control.

Upcoming

explore more open-source technologies while solving real life problems.

Stay tuned and happy deploying!

Top comments (0)