UbuntuUbuntu Based

How To Install Coolify on Ubuntu 24.04 LTS

Install Coolify on Ubuntu 24.04

Deploying applications efficiently requires robust tools that simplify the process while maintaining flexibility and control. Coolify offers an impressive solution for developers seeking a self-hosted alternative to platforms like Heroku. This comprehensive guide will walk you through the complete process of installing Coolify on Ubuntu 24.04 LTS, from preparation to optimization. By following these detailed instructions, you’ll establish a powerful deployment platform tailored to your specific needs and requirements.

Table of Contents

What is Coolify?

Coolify is an open-source, self-hosted platform that functions as a powerful alternative to cloud-based services like Heroku. It provides developers with complete control over their deployment infrastructure while eliminating vendor lock-in and reducing ongoing costs associated with commercial PaaS solutions. This containerized deployment platform leverages Docker to simplify the process of launching and managing applications, databases, and services.

At its core, Coolify enables automated deployments directly from Git repositories, supporting various technologies including Node.js, Python, PHP, Ruby, and more. The platform seamlessly handles the build process, container management, and scaling, allowing developers to focus on code rather than infrastructure complexities.

Key features include:

  • One-click deployments from Git repositories
  • Support for multiple programming languages and frameworks
  • Built-in database deployment options
  • Automatic SSL certificate management
  • Custom domain configurations
  • Intuitive dashboard for resource monitoring
  • Webhooks for CI/CD integration

The self-hosted nature of Coolify provides significant advantages over cloud alternatives, including enhanced privacy, complete data control, customizable infrastructure, and potentially lower long-term costs. Organizations with specific compliance requirements particularly benefit from this approach, as all data and processes remain within their controlled environment.

System Requirements

Before proceeding with Coolify installation on Ubuntu 24.04 LTS, ensure your system meets the necessary requirements for optimal performance and stability.

Minimum hardware specifications:

  • CPU: 2 cores (more recommended for production environments)
  • RAM: 2GB (4GB recommended for better performance)
  • Storage: 30GB SSD (40GB or more recommended)
  • Network: Stable internet connection with port 22 (SSH) accessible

Recommended hardware for production:

  • CPU: 4+ cores
  • RAM: 8GB or more
  • Storage: 80GB+ SSD storage
  • Network: Stable connection with dedicated IP address

Software prerequisites:

  • Ubuntu 24.04 LTS (Noble Numbat)
  • Docker Engine version 24+ (not installed via snap)
  • Root or sudo access to the server
  • SSH access configured properly

Coolify supports both AMD64 and ARM64 architectures, making it versatile across various hardware platforms. For optimal performance in production environments, consider allocating additional resources, particularly if you plan to host multiple applications or resource-intensive services.

Pre-Installation Preparation

Proper preparation ensures a smooth Coolify installation process and helps prevent common issues. Follow these steps to properly prepare your Ubuntu 24.04 LTS server.

Update System Packages

Always begin with a fully updated system to ensure compatibility and security:

sudo apt update && sudo apt upgrade -y

Install Essential Tools

Install the prerequisite packages needed for Coolify operation:

sudo apt install curl wget git jq openssl vim -y

These tools are crucial for Coolify’s functionality. The installation script will check for these dependencies, but installing them beforehand can prevent potential issues.

SSH Configuration

Proper SSH configuration is essential since Coolify uses SSH for server management:

  1. Ensure SSH is running: sudo systemctl status ssh
  2. If not installed: sudo apt install openssh-server -y
  3. Enable and start the service:
    sudo systemctl enable ssh
    sudo systemctl start ssh
  4. Configure SSH for secure access by editing /etc/ssh/sshd_config to disable root login and password authentication if needed.

Firewall Setup

Configure the firewall to allow necessary traffic while blocking unwanted access:

sudo ufw allow 22/tcp    # SSH
sudo ufw allow 80/tcp    # HTTP
sudo ufw allow 443/tcp   # HTTPS
sudo ufw allow 8000/tcp  # Coolify dashboard
sudo ufw enable

Verify the firewall status with sudo ufw status.

Domain Configuration (Optional but Recommended)

While not strictly required, configuring a domain for your Coolify instance enhances security and usability:

  1. Purchase or use an existing domain name
  2. Create an A record pointing to your server’s IP address
  3. Wait for DNS propagation (typically 5 minutes to 48 hours)

Having a domain ready will make it easier to set up SSL certificates later and provide a more professional access URL than an IP address.

Quick Installation Method

The quick installation method is the recommended approach for most users, as it automates the process and minimizes the potential for errors. This streamlined approach handles all the necessary configurations and dependencies.

Step 1: Execute the Installation Script

Run the following command to start the automated installation process:

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

If you’re not logged in as the root user, use sudo:

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

The installation script performs the following operations:

  • Installs essential tools (curl, wget, git, jq, openssl)
  • Installs Docker Engine (version 24+)
  • Configures Docker settings (logging, daemon)
  • Sets up directories at /data/coolify
  • Configures SSH keys for server management
  • Installs and starts Coolify

The process typically takes 1-2 minutes to complete. Do not cancel it once started.

Step 2: Verify Installation

Upon successful installation, you’ll see a success message with your Coolify URL, typically formatted as:

Congratulations!
Your instance is ready to use.
Please visit http://your-server-ip:8000 to get started.

The installation script often displays a joke while you wait for the final configuration steps to complete.

Troubleshooting Common Issues

Docker Rate Limit Issue: If you encounter a “Too Many Requests” error during installation, this is likely due to Docker Hub rate limits. To resolve this:

  1. Create a Docker Hub account if you don’t have one
  2. Log in with: docker login -u your_username
  3. If the rate limit persists, try disabling IPv6:
    sudo nano /etc/sysctl.conf

    Add these lines:

    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1

    Apply changes with: sudo sysctl -p

  4. Restart Docker: sudo systemctl restart docker.socket docker.service

Installation Halts After Displaying a Random String: This issue has been reported with certain beta versions on Ubuntu 24.04. Try using a stable release or using the manual installation method instead.

Manual Installation Method

The manual installation method provides more control over the setup process and can be useful when troubleshooting issues with the automated script. This approach requires more steps but allows for customization during installation.

Step 1: Create Directory Structure

Create the necessary directory structure for Coolify:

mkdir -p /data/coolify/{source,ssh,applications,databases,backups,services,proxy,webhooks-during-maintenance}
mkdir -p /data/coolify/ssh/{keys,mux}
mkdir -p /data/coolify/proxy/dynamic

These directories will store Coolify’s configuration files, SSH keys, and various application data.

Step 2: Generate and Configure SSH Keys

Generate an SSH key for Coolify to manage your server:

ssh-keygen -f /data/coolify/ssh/keys/coolify@server -t ed25519 -N '' -C root@coolify

Add the public key to your authorized keys file:

cat /data/coolify/ssh/keys/coolify@server.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

This allows Coolify to authenticate and manage the server securely.

Step 3: Install Docker Engine

If Docker isn’t already installed, install it following the official documentation for Ubuntu 24.04 LTS:

# Add Docker's official GPG key
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
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=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu noble stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

# Install Docker Engine
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Remember that Docker installed via snap is not supported by Coolify.

Step 4: Configure Docker Network

Create a Docker network for Coolify:

docker network create coolify

Step 5: Download Configuration Files

Fetch the necessary configuration files from Coolify’s CDN:

curl -o /data/coolify/source/docker-compose.yml https://cdn.coollabs.io/coolify/docker-compose.yml
curl -o /data/coolify/source/docker-compose.prod.yml https://cdn.coollabs.io/coolify/docker-compose.prod.yml
curl -o /data/coolify/source/.env.production https://cdn.coollabs.io/coolify/env.production
curl -o /data/coolify/source/upgrade.sh https://cdn.coollabs.io/coolify/upgrade.sh

Step 6: Start Coolify

Launch the Coolify service:

cd /data/coolify/source
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d

This completes the manual installation process. You can now access Coolify at http://your-server-ip:8000.

Post-Installation Access and Setup

After successful installation, it’s crucial to properly configure your Coolify instance for secure and efficient operation.

Initial Access

Access your Coolify instance by navigating to:

http://your-server-ip:8000

You’ll be directed to a registration page to create your first admin account.

Install Coolify on Ubuntu 24.04

⚠️ Security Warning: Create your admin account immediately after installation. Anyone who accesses the registration page first can gain full control of your server.

Admin Account Creation

When creating the admin account:

  1. Provide a strong password
  2. Use a valid email address for password recovery
  3. Consider setting up two-factor authentication later for enhanced security

Dashboard Navigation

After logging in, you’ll see the Coolify dashboard with several key sections:

  • Overview: System status and resource usage
  • Projects: Manage your deployed applications
  • Resources: Configure databases and services
  • Settings: Adjust system configurations

Take time to familiarize yourself with the interface before proceeding to more advanced configurations.

Setting Up Fully Qualified Domain Name

For enhanced security and usability, configure a domain name for your Coolify instance:

  1. Navigate to Settings in the dashboard
  2. Find “Instance Settings”
  3. Enter your fully qualified domain name (e.g., https://coolify.yourdomain.com)
  4. Save the changes

Coolify will automatically configure SSL for your domain using Let’s Encrypt, providing secure HTTPS access to your dashboard.

Server Configuration

Properly configuring your server settings ensures optimal performance and security for your Coolify instance and deployed applications.

Local vs. Remote Server Setup

During the onboarding process, you’ll need to choose between deploying to your localhost or a remote server:

  1. For most production setups, select “Remote Server”
  2. For development or testing environments, “Localhost” may be appropriate

SSH Key Management

Managing SSH keys properly is crucial for secure deployment operations:

  1. Verify the SSH key generated during installation
  2. If you prefer to use your own SSH key:
    • Navigate to Server Settings
    • Select “Use Custom SSH Key”
    • Paste your private key
    • Ensure the corresponding public key is in the server’s authorized_keys file

Resource Allocation

Optimize resource allocation based on your server’s capabilities:

  1. Navigate to Server Settings
  2. Configure CPU and memory limits for containers
  3. Set appropriate swap space configurations

For high-traffic applications, consider increasing the allocated resources to ensure consistent performance.

Network and Firewall Configuration

Ensure your network settings allow proper communication:

  1. Verify open ports for application access (typically 80 and 443)
  2. Configure domain routing for applications
  3. Set up reverse proxy rules if needed

Security Best Practices

Implement these security measures for a production environment:

  1. Enable automatic updates for security patches
  2. Configure regular backups
  3. Implement IP-based access restrictions for sensitive endpoints
  4. Monitor server logs for unusual activity
  5. Consider implementing a Web Application Firewall (WAF)

Deploying Your First Application

Coolify’s primary purpose is to streamline application deployment. Follow these steps to deploy your first application.

Creating a New Project

Start by organizing your deployments:

  1. Navigate to the Projects section in the dashboard
  2. Click “New Project”
  3. Provide a descriptive name for your project
  4. Optionally, add a description and tags for better organization

Application Deployment Methods

Choose the appropriate deployment method:

Git Repository Deployment:

  1. Select “Deploy from Git”
  2. Connect your GitHub, GitLab, or Bitbucket account
  3. Select the repository to deploy
  4. Configure the branch to deploy from (typically main or master)

Docker Image Deployment:

  1. Select “Deploy from Docker Image”
  2. Specify the Docker image to use
  3. Configure any required environment variables or volume mounts

Environment Configuration

Set up the necessary environment for your application:

  1. Configure environment variables through the UI
  2. Set up secrets for sensitive information
  3. Configure port mappings for application access

Deployment Verification

After triggering deployment:

  1. Monitor the build logs for any errors
  2. Check the application status indicators
  3. Verify application functionality by accessing the provided URL
  4. Set up monitoring to track application health

Troubleshooting Common Deployment Issues

If you encounter problems during deployment:

  • Check application logs for specific error messages
  • Verify that all required environment variables are set
  • Ensure sufficient resources are allocated
  • Check network connectivity between Coolify and your Git provider
  • Verify that the Dockerfile or build instructions are correct

Database and Service Integration

Most applications require databases or additional services. Coolify simplifies their deployment and integration.

Setting Up Databases

Deploy and manage databases with these steps:

  1. Navigate to Resources → Databases
  2. Select “Add New Database”
  3. Choose from supported database types (MySQL, PostgreSQL, MongoDB, Redis, etc.)
  4. Configure database name, user, and password
  5. Set resource limits appropriate for your workload
  6. Deploy the database

Connecting Applications to Databases

Link your application with its database:

  1. Go to your application’s environment variables
  2. Add the database connection string or individual connection parameters
  3. Format should follow your application’s expected structure
  4. Use Coolify’s built-in variable linking for secure connections between containers

Service Deployment Options

Deploy supporting services for your application:

  1. Navigate to Resources → Services
  2. Select “Add New Service”
  3. Choose from available service templates or custom Docker images
  4. Configure service-specific settings
  5. Deploy the service

Configuration and Security

Ensure proper security for your data services:

  1. Use strong, unique passwords for database accounts
  2. Limit database exposure (avoid public access)
  3. Enable database backups
  4. Configure appropriate resource limits
  5. Implement database monitoring

Backup and Persistence Strategies

Protect your data with proper persistence configuration:

  1. Configure volume mounts for data persistence
  2. Set up automated backup schedules
  3. Test backup restoration procedures
  4. Consider offsite backup solutions for critical data

Advanced Configuration

For experienced users, Coolify offers advanced configuration options to customize deployment behavior and optimize performance.

Custom Docker Network Configuration

Fine-tune your Docker networking:

  1. Define custom network configurations through environment variables
  2. Set custom Docker network pools to avoid conflicts with existing networks
  3. Configure specific IP ranges for container networks

To define a custom Docker network during installation:

export COOLIFY_DOCKER_NETWORK_RANGE=172.31.0.0/16
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash

Environment Variables for Customization

Customize Coolify’s behavior with environment variables:

  1. Set COOLIFY_APP_ID and COOLIFY_SECRET_KEY for unique instance identification
  2. Configure COOLIFY_DATABASE_URL for custom database connections
  3. Set COOLIFY_HOSTED_ON to identify your hosting provider

Resource Limiting and Optimization

Implement container resource constraints:

  1. Set CPU limits to prevent container monopolization
  2. Configure memory limits to avoid out-of-memory issues
  3. Implement swap limitations for consistent performance
  4. Configure disk I/O restrictions for shared environments

Webhooks and CI/CD Integration

Extend Coolify with external integrations:

  1. Configure webhooks for build and deployment events
  2. Integrate with CI/CD pipelines like GitHub Actions or GitLab CI
  3. Set up notification systems for deployment status
  4. Implement custom scripts for pre/post-deployment actions

Multi-server Deployment Architecture

Scale your infrastructure with multiple servers:

  1. Add additional servers to your Coolify instance
  2. Configure load balancing between servers
  3. Implement high-availability configurations
  4. Distribute applications based on resource requirements

Maintenance and Updates

Regular maintenance ensures your Coolify installation remains secure and performs optimally over time.

Backup Strategies for Coolify Data

Protect your deployment configuration:

  1. Regularly backup the /data/coolify directory
  2. Implement automated backup scripts for configuration data
  3. Store backups securely off-server
  4. Document restoration procedures for disaster recovery

Sample backup script:

#!/bin/bash
BACKUP_DATE=$(date +%Y-%m-%d-%H-%M)
BACKUP_DIR="/backups/coolify"
mkdir -p $BACKUP_DIR
tar -czf $BACKUP_DIR/coolify-backup-$BACKUP_DATE.tar.gz /data/coolify
# Add code to push to remote storage

Update Procedures and Best Practices

Keep Coolify updated with these best practices:

  1. Check for updates regularly in the dashboard
  2. Review changelog before updating
  3. Backup before performing updates
  4. Update during low-traffic periods
  5. Test functionality after updates

To update Coolify manually:

cd /data/coolify/source
./upgrade.sh

Monitoring Server Resource Usage

Maintain awareness of system performance:

  1. Monitor CPU, memory, and disk usage regularly
  2. Set up alerting for resource thresholds
  3. Track container resource consumption
  4. Identify resource-intensive applications
  5. Implement performance optimization where needed

Log Management and Troubleshooting

Efficiently manage logs for troubleshooting:

  1. Configure log rotation to prevent disk space issues
  2. Implement centralized logging for easier analysis
  3. Set appropriate log levels (debug for troubleshooting, info for production)
  4. Regularly review logs for warning signs

Disaster Recovery Planning

Prepare for potential system failures:

  1. Document complete recovery procedures
  2. Test restoration processes periodically
  3. Maintain current system configuration documentation
  4. Implement redundancy for critical components
  5. Establish recovery time objectives

Performance Optimization

Optimize your Coolify instance for maximum efficiency and performance.

Resource Allocation Recommendations

Allocate resources strategically:

  1. Prioritize memory for database services
  2. Allocate more CPU to computation-intensive applications
  3. Reserve resources for the Coolify system itself
  4. Consider vertical scaling for resource-intensive applications

Caching Strategies

Implement caching for improved performance:

  1. Configure Redis or Memcached for application caching
  2. Implement CDN integration for static assets
  3. Enable browser caching through appropriate headers
  4. Use build caching to speed up deployment processes

Build Optimization Techniques

Speed up build processes:

  1. Optimize Dockerfiles for faster builds
  2. Implement multi-stage builds to reduce image size
  3. Configure .dockerignore to exclude unnecessary files
  4. Use build cache effectively by ordering operations efficiently

Load Balancing Considerations

For high-traffic applications:

  1. Implement container replication for horizontal scaling
  2. Configure load balancing between containers
  3. Consider implementing a dedicated reverse proxy like Traefik or Nginx
  4. Distribute database loads with read replicas when applicable

Congratulations! You have successfully installed Coolify. Thanks for using this tutorial for installing Coolify open-source panel on Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the official Coolify website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button