← Go back

How to Install the Self-Hosted Version of Coolify

Date

Prerequisites

  • A server with SSH access (VPS, Raspberry Pi, or any other server)
  • Supported Operating Systems:
    • Debian based (Debian, Ubuntu, etc.)
    • Redhat based (CentOS, Fedora, Redhat, AlmaLinux, Rocky, etc.)
    • SUSE based (SLES, SUSE, openSUSE, etc.)
    • Arch Linux
    • Raspberry Pi OS (Raspbian)
  • Supported Architectures: AMD64, ARM64
  • Minimum Server Requirements:
    • 2 CPUs
    • 2 GBs memory
    • 30+ GB of storage for images

Installation

Automated Installation

  1. SSH Enabled: Ensure SSH is enabled and you can connect to your server with the root user.

  2. Curl Installed: Make sure curl command is available on your server.

  3. Install Coolify: Execute the following command on your server with the root user.

    curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
    
  4. Access Coolify's UI: Open your browser and navigate to http://<ip>:8000 of your server.

Manual Installation

  1. SSH Enabled: Ensure SSH is enabled and you can connect to your server with the root user.

  2. Curl Installed: Make sure curl command is available on your server.

  3. Install Docker Engine (24+): Follow the official documentation to install Docker Engine on your server.

  4. Create Directories:

    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
    
  5. Generate SSH Key:

    ssh-keygen -f /data/coolify/ssh/keys/id.root@host.docker.internal -t ed25519 -N '' -C root@coolify
    
  6. Setup Your SSH Key:

    cat /data/coolify/ssh/keys/id.root@host.docker.internal.pub >> ~/.ssh/authorized_keys
    chmod 600 ~/.ssh/authorized_keys
    
  7. Setup Configuration Files:

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

    chown -R 9999:root /data/coolify
    chmod -R 700 /data/coolify
    
  9. Generate Values:

    sed -i "s|APP_ID=.*|APP_ID=$(openssl rand -hex 16)|g" /data/coolify/source/.env
    sed -i "s|APP_KEY=.*|APP_KEY=base64:$(openssl rand -base64 32)|g" /data/coolify/source/.env
    sed -i "s|DB_PASSWORD=.*|DB_PASSWORD=$(openssl rand -base64 32)|g" /data/coolify/source/.env
    sed -i "s|REDIS_PASSWORD=.*|REDIS_PASSWORD=$(openssl rand -base64 32)|g" /data/coolify/source/.env
    sed -i "s|PUSHER_APP_ID=.*|PUSHER_APP_ID=$(openssl rand -hex 32)|g" /data/coolify/source/.env
    sed -i "s|PUSHER_APP_KEY=.*|PUSHER_APP_KEY=$(openssl rand -hex 32)|g" /data/coolify/source/.env
    sed -i "s|PUSHER_APP_SECRET=.*|PUSHER_APP_SECRET=$(openssl rand -hex 32)|g" /data/coolify/source/.env
    
  10. Default Docker Network:

    docker network create --attachable coolify
    
  11. Start Coolify:

    docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml up -d --pull always --remove-orphans --force-recreate
    
  12. Access Coolify's UI: Open your browser and navigate to http://<ip>:8000 of your server.

Docker Desktop (Not Recommended for Production)

  1. Install Docker Desktop for Windows.

  2. Create a directory for Coolify data, e.g., C:\Users\yourusername\coolify.

  3. Copy docker-compose.windows.yml and .env.windows-docker-desktop.example to the created directory.

  4. Rename docker-compose.windows.yml to docker-compose.yml.

  5. Rename .env.windows-docker-desktop.example to .env.

  6. Create a Coolify Docker network:

    docker network create coolify
    
  7. Optional: Change the values in the .env file.

  8. Start Coolify:

    docker compose up
    
  9. Access Coolify on localhost:8000 of your machine.

Note: Coolify Proxy is still not working on Windows.

Conclusion

You have successfully installed the self-hosted version of Coolify on your server. Coolify simplifies the deployment and management of applications, making it a powerful tool for developers. For more information and advanced configuration options, refer to the official Coolify documentation.

Other Blog Posts

vercel-vs-netlify-vs-cloudflare.md

This is a summary of the post.

Read More

2fas.md

This is a summary of the post.

Read More

hostinger-vs-wix.md

This is a summary of the post.

Read More