How to Install Coolify on Ubuntu 24.04 VPS for Self-Hosting

Introduction

If you're looking to set up a self-hosted environment for managing Docker containers, Coolify is an excellent open-source platform that simplifies this process. At ByteHosting, we understand the importance of reliable, affordable hosting solutions, and deploying Coolify on your Ubuntu 24.04 VPS is a straightforward way to gain full control over your containerized applications.

In this step-by-step tutorial, we will guide you through the entire process of installing Coolify on Ubuntu VPS. Whether you're a beginner or have some experience with Linux servers, our instructions are designed to be clear and easy to follow. Let's get started!

Prerequisites: Setting up Your Ubuntu 24.04 VPS

Before we begin, ensure you have a fresh Ubuntu 24.04 VPS. At ByteHosting, we offer cost-effective VPS plans in our Frankfurt am Main data center, which are perfect for hosting applications like Coolify. You should have root or sudo access to your server to perform the installation.

If you haven't already, connect to your server via SSH:

ssh username@your-server-ip

Replace username and your-server-ip with your actual server login details. Once connected, update your package list:

sudo apt update && sudo apt upgrade -y

Installing Docker and Docker Compose on Ubuntu 24.04

Coolify relies on Docker to manage containers. Therefore, the first step is to install Docker and Docker Compose.

Installing Docker

Run the following commands to install Docker:

sudo apt install -y apt-transport-https ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io

Verify Docker is installed correctly:

docker --version

Installing Docker Compose

Next, install Docker Compose:

sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

Downloading and Installing Coolify on Ubuntu

With Docker and Docker Compose ready, we can now download and run Coolify. We will use the official Coolify Docker image for this purpose.

Create a directory for Coolify

mkdir ~/coolify && cd ~/coolify

Create a Docker Compose file

In this directory, create a file named docker-compose.yml:

nano docker-compose.yml

Paste the following configuration into the file:

version: '3.8'

services:
  coolify:
    image: coolify/coolify
    container_name: coolify
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    environment:
      - NODE_ENV=production
    volumes:
      - coolify-data:/app/data

volumes:
  coolify-data:

This configuration pulls the latest Coolify image and maps ports 80 and 443 for web access.

Start Coolify

Run the following command to launch Coolify:

sudo docker-compose up -d

Docker will download the image and start the container. You can check if it's running with:

docker ps

Configuring Coolify for Your Environment

Once the container is running, you can access the Coolify dashboard through your server's IP address in a web browser:

http://your-server-ip

The first time you access the dashboard, you'll be prompted to set up an admin account. Follow the on-screen instructions to complete the setup.

Testing the Coolify Deployment and Accessing the Dashboard

After setup, log in to the Coolify dashboard. You should see a user-friendly interface where you can start deploying and managing Docker containers. This platform makes self-hosting applications much easier, even for beginners.

Troubleshooting Common Installation Issues

  • Cannot access the dashboard: Ensure your server's firewall allows traffic on ports 80 and 443. You can use ufw to open these ports:
  • Docker container not starting: Check logs with docker logs coolify for errors.
  • Persistent data issues: Make sure the volume coolify-data is correctly mounted and has proper permissions.
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw reload

Conclusion

Deploying Coolify on your Ubuntu 24.04 VPS is a powerful way to manage Docker containers with ease. At ByteHosting, we provide reliable, affordable VPS hosting in Frankfurt am Main, making it simple for you to set up and run self-hosted applications like Coolify. Follow our step-by-step guide, and you'll have your container management platform up and running in no time. If you encounter any issues, our support team is here to help. Happy hosting!

Read more