Coolify is an open-source, self-hostable alternative to platforms like Heroku, Netlify, and Vercel that makes deploying applications incredibly simple. Combined with Ramnode’s reliable and affordable VPS hosting, you can create a powerful deployment platform for your projects. This guide will walk you through the entire setup process from start to finish.
What is Coolify?
Coolify is a self-hosted platform-as-a-service (PaaS) that allows you to deploy applications with git-based workflows, automatic SSL certificates, and built-in monitoring. It supports various technologies including Docker, Node.js, PHP, Python, Go, Rust, and more.
Prerequisites
Before we begin, you’ll need:
- A Ramnode VPS with at least 2GB RAM (4GB recommended)
- Ubuntu 22.04 LTS or newer (this guide uses Ubuntu 22.04)
- A domain name pointed to your VPS IP address
- Basic familiarity with command line operations
Setting Up Your Ramnode VPS
First, ensure your VPS is properly configured:
Initial Server Setup
# Update your system
sudo apt update && sudo apt upgrade -y
# Install essential packages
sudo apt install -y curl wget git unzip software-properties-common apt-transport-https ca-certificates gnupg lsb-release
# Create a new user (optional but recommended)
sudo adduser coolify
sudo usermod -aG sudo coolify
su - coolify
Configure Firewall
# Enable UFW firewall
sudo ufw enable
# Allow SSH, HTTP, and HTTPS
sudo ufw allow 22
sudo ufw allow 80
sudo ufw allow 443
sudo ufw allow 8000 # Coolify dashboard
Install Docker
Coolify requires Docker to function. Install Docker using the official installation script:
# Download and install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Add your user to the docker group
sudo usermod -aG docker $USER
# Start and enable Docker
sudo systemctl start docker
sudo systemctl enable docker
# Install Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/v2.21.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Verify installation
docker --version
docker-compose --version
Important: Log out and log back in for the group changes to take effect.
Install Coolify
Now we’ll install Coolify using their official installation script:
# Download and run Coolify installation script
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
The installation script will:
- Download the latest Coolify version
- Set up the necessary Docker containers
- Configure the initial settings
- Start the Coolify services
Initial Coolify Configuration
Access the Dashboard
Once installation is complete, you can access Coolify at:
http://your-server-ip:8000
First-Time Setup
- Create Admin Account: You’ll be prompted to create an administrator account
- Configure Email Settings: Set up SMTP for notifications (optional but recommended)
- Set Your Domain: Configure your primary domain for the Coolify instance
Configure Domain and SSL
To set up your custom domain:
- Point your domain’s A record to your VPS IP address
- In Coolify dashboard, go to Settings > Configuration
- Update the “Instance Domain” field with your domain
- Enable “Force HTTPS” for automatic SSL certificate generation
Configure Reverse Proxy
Coolify uses Traefik as a reverse proxy. Configure it properly:
# Check Traefik status
docker ps | grep traefik
# View Traefik logs if needed
docker logs coolify-proxy
Set Up Your First Application
Connect a Git Repository
- Navigate to “Projects” in the Coolify dashboard
- Create a new project
- Add a new application
- Connect your Git repository (GitHub, GitLab, etc.)
- Configure build and deployment settings
Deploy Your Application
- Select your repository and branch
- Configure environment variables
- Set up build commands and deployment settings
- Deploy your application
Security Hardening
Change Default Ports (Optional)
If you want to change the default port from 8000:
# Stop Coolify
cd /data/coolify/source
docker-compose down
# Edit the configuration
sudo nano .env
# Change COOLIFY_APP_PORT=8000 to your desired port
# Restart Coolify
docker-compose up -d
Set Up Backup
Configure automated backups of your Coolify data:
# Create backup script
sudo mkdir -p /opt/scripts
sudo nano /opt/scripts/coolify-backup.sh
Add the following backup script:
#!/bin/bash
BACKUP_DIR="/opt/backups/coolify"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p $BACKUP_DIR
# Backup Coolify data
docker run --rm -v coolify-data:/data -v $BACKUP_DIR:/backup alpine tar czf /backup/coolify-data-$DATE.tar.gz -C /data .
# Keep only last 7 backups
find $BACKUP_DIR -name "coolify-data-*.tar.gz" -mtime +7 -delete
Make it executable and set up a cron job:
sudo chmod +x /opt/scripts/coolify-backup.sh
sudo crontab -e
# Add: 0 2 * * * /opt/scripts/coolify-backup.sh
Monitoring and Maintenance
Monitor Resource Usage
# Check Docker containers
docker ps
# Monitor system resources
htop
df -h
Update Coolify
To update Coolify to the latest version:
curl -fsSL https://cdn.coollabs.io/coolify/upgrade.sh | bash
Troubleshooting Common Issues
Port Conflicts
If you encounter port conflicts:
# Check what's using port 8000
sudo netstat -tulpn | grep :8000
# Stop conflicting services if necessary
sudo systemctl stop service-name
Docker Issues
# Restart Docker if needed
sudo systemctl restart docker
# Clean up unused containers
docker system prune -a
SSL Certificate Issues
If SSL certificates fail to generate:
- Ensure your domain properly points to your VPS
- Check that ports 80 and 443 are accessible
- Verify no other web server is running on these ports
Performance Optimization
Optimize for Ramnode VPS
- Memory Management: Monitor memory usage and adjust Docker container limits
- Storage: Use Ramnode’s SSD storage efficiently by cleaning up unused Docker images
- Network: Take advantage of Ramnode’s high-speed network for faster deployments
# Clean up Docker resources periodically
docker system prune -a --volumes
Conclusion
You now have Coolify running on your Ramnode VPS! This setup provides you with a powerful, self-hosted platform for deploying applications with automated deployments, SSL certificates, and monitoring.
Key benefits of this setup:
- Cost-effective: Ramnode’s competitive pricing
- Performance: SSD storage and high-speed network
- Control: Full control over your deployment platform
- Scalability: Easy to upgrade your VPS as needed
Remember to regularly update both your VPS and Coolify installation to maintain security and access the latest features. With this foundation, you can deploy multiple applications, set up staging environments, and create a robust development workflow.
Next Steps
Consider exploring these advanced features:
- Setting up multiple environments (staging, production)
- Integrating with external databases
- Setting up monitoring and alerting
- Configuring custom domains for applications
- Implementing CI/CD pipelines with webhooks