In an era where control over your digital infrastructure is paramount, self-hosting solutions offer unparalleled freedom and cost-efficiency. This comprehensive guide will walk you through the process of installing Coolify on an Ubuntu 24.04 LTS server. Coolify is a powerful, open-source, and self-hostable alternative to popular platforms like Heroku, Netlify, and Vercel. By the end of this Tutorial, you will have a fully operational Coolify instance, ready to deploy your applications, databases, and services with ease, giving you complete command over your development and deployment workflows without vendor lock-in or escalating cloud bills.
Prerequisites for a Smooth Installation
Before diving into the installation process, ensure your server meets the following requirements to guarantee a seamless experience:
- Ubuntu 24.04 LTS Server: A fresh installation is highly recommended to avoid potential conflicts with existing software.
- Minimum Server Specifications: At least 2GB of RAM and 2 CPU cores. For production environments or deploying multiple applications, 4GB+ RAM and 4+ CPU cores are strongly advised.
- Domain Name: A registered domain name pointed to your server’s public IP address. You’ll need an ‘A’ record for your main domain (e.g.,
coolify.yourdomain.com) and a wildcard ‘A’ record (e.g.,*.coolify.yourdomain.com) pointing to the same IP. This is crucial for Coolify to manage subdomains for your deployed applications. - SSH Access: Secure Shell (SSH) access to your server with a user account that has
sudoprivileges. - Basic Linux Familiarity: Comfort with command-line operations is beneficial, though this guide aims to be beginner-friendly.
Step 1: Prepare Your Ubuntu Server
A well-prepared server is the foundation for a stable Coolify installation. Let’s ensure your system is up-to-date and secure.
Update and Upgrade System Packages
Always start by refreshing your package lists and upgrading any outdated software. This ensures you have the latest security patches and software versions. Mastering your APT skill
sudo apt update
sudo apt upgrade -y
sudo apt autoremove -y
Pro-Tip: Running sudo apt autoremove -y after an upgrade cleans up any orphaned dependencies, freeing up disk space.
Configure the Firewall with UFW
Ubuntu’s Uncomplicated Firewall (UFW) is excellent for securing your server. We’ll configure it to allow essential traffic.
sudo ufw allow OpenSSH
sudo ufw allow http
sudo ufw allow https
sudo ufw enable
You’ll be prompted to confirm enabling the firewall; type y and press Enter. Verify the firewall status:
sudo ufw status
Warning: Ensure you allow OpenSSH before enabling UFW, otherwise you might lock yourself out of your server!
Set Up a Non-Root Sudo User (If Not Already Done)
It’s a security best practice to perform administrative tasks with a non-root user that has sudo privileges, rather than directly as the root user. If you’re already logged in with a sudo user, you can skip creating a new one.
sudo adduser yourusername
sudo usermod -aG sudo yourusername
Replace yourusername with your desired username. Log out and log back in with this new user to ensure the group changes take effect.
Step 2: Install Docker and Docker Compose
Coolify leverages Docker to containerize applications and services, providing isolation and portability. We need to install Docker Engine and the Docker Compose plugin.
Install Docker Engine
First, remove any old versions of Docker that might be present:
for pkg in docker.io docker-doc docker-compose docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin podman-docker; do sudo apt remove $pkg; done
Then, install Docker’s official packages:
# Add Docker's official GPG key:
sudo apt update
sudo apt install ca-certificates curl gnupg -y
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
Verify Docker Installation
Run a simple Docker command to ensure everything is working correctly:
sudo docker run hello-world
You should see a message indicating Docker is installed and running.
Add Your User to the Docker Group
To run Docker commands without sudo, add your user to the docker group. Remember to replace yourusername.
sudo usermod -aG docker yourusername
You’ll need to log out and log back in (or restart your SSH session) for this change to take effect.
Pro-Tip: Docker is the backbone of Coolify, enabling it to manage diverse applications and their dependencies in isolated environments. Understanding basic Docker commands will be beneficial for troubleshooting.
Step 3: Install Coolify
With Docker ready, installing Coolify itself is surprisingly straightforward, thanks to its official installation script.
Execute the Coolify Installation Script
Run the following command. This script will download and set up Coolify using Docker Compose.
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
The script will guide you through the initial setup, asking for your domain name for Coolify’s web interface. Provide the main domain you configured (e.g., coolify.yourdomain.com).
Warning: This process can take several minutes as it downloads Docker images. Do not interrupt it. If you encounter errors, double-check your Docker installation and firewall settings.
Example: During the script execution, you might see output indicating Docker containers being pulled and started, similar to:
... pulling coolify/coolify:latest
... creating coolify_coolify_1
... creating coolify_traefik_1
... creating coolify_coolify-db_1
Coolify installed successfully!
Step 4: Access the Coolify Web Interface
Once the installation script completes, Coolify should be up and running. You can now access its user-friendly web interface.
Navigate to Your Coolify Domain
Open your web browser and go to the domain name you provided during the installation (e.g., https://coolify.yourdomain.com). If you haven’t configured DNS yet, you might be able to access it via your server’s IP address, but this is not recommended for long-term use.
Initial Setup: The first time you access Coolify, you’ll be prompted to create an administrator account. Provide a strong username and password.
Pro-Tip: If you initially access via IP and see a certificate warning, it’s because Coolify is likely trying to serve a self-signed certificate or waiting for Let’s Encrypt to provision one for your domain. Once your domain’s DNS is fully propagated and configured within Coolify, HTTPS will work seamlessly.
Step 5: Configure Domain and SSL within Coolify
For production readiness, proper domain and SSL configuration is essential.
Add Your Domain and Enable SSL
After logging into the Coolify dashboard:
- Navigate to Settings (usually a gear icon).
- Go to the General tab or a similar section for domain configuration.
- Ensure your main Coolify domain is correctly listed. Coolify will automatically attempt to provision a Let’s Encrypt SSL certificate for it.
- For your applications, you’ll configure their specific domains and SSL within their respective settings once deployed.
Warning: DNS propagation can take up to 48 hours, though it’s often much faster. If your domain isn’t resolving, Coolify won’t be able to obtain an SSL certificate. Use tools like dig or online DNS checkers to verify your A records.
Step 6: Integrate with Git Providers (Optional but Recommended)
To deploy applications directly from your source code repositories, connect Coolify to your Git provider (GitHub, GitLab, Bitbucket, etc.).
Connect Your Git Account
- In the Coolify dashboard, find the Source Providers or Integrations section.
- Select your preferred Git provider (e.g., GitHub).
- Follow the on-screen instructions to authorize Coolify. This typically involves generating an SSH key pair within Coolify and adding the public key to your Git provider’s SSH keys settings.
Example Use Case: Deploying a Web Application
Once connected, you can create a new application in Coolify, point it to a specific repository and branch, and Coolify will automatically build and deploy it. For instance, to deploy a Node.js application, you’d select ‘Node.js’ as the build pack, specify your repository URL, and Coolify handles the rest, from fetching the code to running npm install and starting your app.
Next Steps with Coolify
Congratulations! You’ve successfully installed Coolify on your Ubuntu 24.04 LTS server. Your journey into self-hosted application management has just begun. Here are some immediate next steps:
- Explore the Dashboard: Familiarize yourself with Coolify’s intuitive interface. Discover sections for applications, databases, services, and more.
- Deploy Your First Application: Start by deploying a simple web application. Coolify supports various build packs (Node.js, PHP, Python, Go, Rust, static sites, Docker images, etc.) and offers easy database provisioning (PostgreSQL, MySQL, MongoDB, Redis).
- Monitor Resources: Keep an eye on your server’s resource usage from within Coolify to ensure optimal performance.
- Stay Updated: Coolify is actively developed. Regularly check for updates within the Coolify interface to benefit from new features and security enhancements.
