For developers, agencies, and startup teams, modern deployment agility is non-negotiable. However, recurring SaaS subscriptions from commercial cloud providers quickly accumulate, often costing hundreds of dollars monthly for basic build pipelines, preview environments, and hosted databases. By deploying Coolify—the open-source, self-hosted alternative to Heroku, Netlify, and Vercel—on a dedicated Linux VPS, you gain an enterprise-grade cloud platform under your absolute control.
Coolify allows you to connect GitHub, GitLab, or raw Git repositories, automatically build applications using Dockerfiles or Nixpacks, provision Let’s Encrypt SSL certificates automatically, and launch managed databases (PostgreSQL, MySQL, Redis, MongoDB) with a single click. This tutorial covers system preparation, firewall configuration, automated installation, GitHub app integration, and multi-service deployment.
1. Minimum Server Specifications & Prerequisites
To ensure smooth build operations and runtime container execution, ensure your VPS meets these baseline recommendations:
- Operating System: Ubuntu 24.04 LTS or 22.04 LTS (clean minimal installation).
- vCPU: Minimum 2 cores (4+ cores recommended if compiling intensive Next.js or Rust builds).
- Memory: Minimum 2GB RAM (4GB or 8GB strongly recommended to prevent build-time memory exhaustion).
- Disk: 30GB+ NVMe SSD storage.
- Networking: Dedicated public IPv4 address with ports 22, 80, 443, and 8000 open.
Before launching the installer, update your system repositories and configure a 2GB swap partition to protect against build spikes:
# Update repository cache and core packages
sudo apt update && sudo apt upgrade -y && sudo apt install -y curl ufw
# Set up 2GB swapfile
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
2. Hardening Firewall & Inbound Port Rules
Coolify relies on port 8000 for initial dashboard access and ports 80 and 443 for Traefik public ingress. Configure UFW firewall rules before launching the installation script:
# Allow SSH access
sudo ufw allow 22/tcp
# Allow HTTP and HTTPS for Traefik proxy
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
# Allow Coolify management dashboard
sudo ufw allow 8000/tcp
# Enable firewall
sudo ufw --force enable
sudo ufw status
3. Installing Coolify via Official Automated Script
Coolify provides an automated bash installer that installs Docker Engine, docker-compose, and coordinates the initialization of Coolify core containers, Traefik reverse proxy, and local PostgreSQL databases:
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | sudo bash
The installation script executes automatically in approximately 2 to 3 minutes. Once the script finishes, you will see a success confirmation displaying the dashboard URL: http://your-server-ip:8000.
4. Initial Dashboard Setup & Custom Domain Configuration
Navigate to http://your-server-ip:8000 in your browser to complete initial configuration:
- Create your primary administrative account with a strong password.
- Navigate to Settings > Instance > General.
- In the FQDN field, enter your desired management subdomain, such as
https://coolify.yourdomain.com. - Point an
ADNS record forcoolify.yourdomain.comto your VPS IP address. - Save settings. Coolify automatically triggers Traefik to request a Let’s Encrypt SSL certificate. You can now close port 8000 (
sudo ufw delete allow 8000/tcp) and access the dashboard securely over HTTPS.
5. Deploying Web Applications & Databases in 1-Click
Coolify makes launching production services seamless:
Deploying from GitHub / GitLab
Connect your GitHub account via Sources > Add New > GitHub App. Coolify guides you through automatic GitHub App generation with proper webhook permissions. Once linked, select any repository and branch. Coolify auto-detects your application runtime (Node.js, Next.js, Django, FastAPI, Laravel, Go) via Nixpacks and deploys it with automated SSL.
Deploying One-Click Databases
Navigate to Projects > Production > + New Resource > Database. Choose PostgreSQL, MySQL, Redis, or ClickHouse. Coolify automatically provisions persistent Docker volumes, generates cryptographically random passwords, and provides internal connection strings that other containers can access securely across the private Docker network.
Automated S3 Database Backups in Coolify
Under any deployed database, navigate to the Backups tab. Enter your S3-compatible credentials (AWS S3, Cloudflare R2, or self-hosted MinIO), define a cron schedule (e.g., 0 3 * * * for 3 AM daily), and Coolify will automatically dump, gzip, and upload encrypted database archives to offsite storage.
Coolify Advanced Configuration, Nixpacks Optimization & Troubleshooting
Optimizing Coolify on Ubuntu VPS ensures maximum build performance and deterministic uptime across complex microservices:
- Tuning Nixpacks Build Caching: Nixpacks automatically infers application dependencies and generates optimized container images without requiring custom Dockerfiles. To accelerate rebuilds from minutes to seconds, Coolify maintains persistent layer caches in
/var/lib/docker/volumes/coolify_cache. Never clear this volume during routine maintenance. - Configuring Environment Secrets at Scale: Coolify provides scoped environment variable management at the Team, Project, and Application levels. Variables prefixed with
SECRET_are automatically encrypted at rest in the Coolify internal PostgreSQL database using AES-256-GCM. - Customizing Traefik Dynamic Middleware: Under Settings > Proxy, administrators can inject custom Traefik configuration snippets. This enables advanced edge capabilities including custom IP whitelists, basic authentication prompts for staging branches, rate limiting, and automated HTTP-to-HTTPS redirects.
- Recovering an Unresponsive Coolify Instance: If the Coolify dashboard becomes inaccessible following a power disruption or unexpected kernel update, connect via SSH and execute the recovery helper script:
# Check status of Coolify core containers docker ps -a --filter "name=coolify" # Restart Coolify management stack cleanly sudo /usr/local/bin/coolify restart
Launch Coolify on High-Speed CpanelFree VPS
Run your self-hosted PaaS without performance bottlenecks. Enjoy full root access, blisteringly fast NVMe storage, and dedicated vCPU cores built for modern developers.
