What is Coolify?
Coolify is a self-hosted alternative to Heroku, Netlify, and Vercel. It provides:- Git-based deployments
- Automatic SSL certificates
- Built-in reverse proxy (Traefik)
- Docker Compose support
- Environment management
- Zero-downtime deployments
Prerequisites
- Coolify instance running (v4.0+)
- Domain name pointed to your Coolify server
- At least 4GB RAM available on Coolify server
Don't have Coolify yet?
Don't have Coolify yet?
Install Coolify on a fresh Ubuntu/Debian server:Access Coolify at
http://your-server-ip:8000See Coolify docs for detailed installation.Deployment Methods
- Git Repository (Recommended)
- Fork Repository
Deploy directly from the Cap GitHub repository.
Deploy from GitHub
Create New Project
- Log in to your Coolify instance
- Click New Project
- Name it “Cap” and click Continue
Configure Repository
Enter repository details:
- Git Repository URL:
https://github.com/CapSoftware/Cap - Branch:
main - Docker Compose File:
docker-compose.coolify.yml - Build Pack: Docker Compose
Set Environment Variables
Coolify will show environment variable inputs. Configure these:Required Variables:
You can also copy variables from
docker-compose.coolify.env.example in the Cap repository.Generate Secrets
Open a terminal and generate secure secrets:Use the output for:
DATABASE_ENCRYPTION_KEYNEXTAUTH_SECRETMEDIA_SERVER_WEBHOOK_SECRET
Configure Domains
Coolify requires domains for services:
- cap-web: Add your main domain (e.g.,
cap.yourdomain.com) - minio: Add S3 domain (e.g.,
s3.yourdomain.com)
- Configure Traefik reverse proxy
- Generate SSL certificates via Let’s Encrypt
- Set up automatic HTTPS redirects
Deploy
Click Deploy to start the deployment.Coolify will:
- Clone the repository
- Pull Docker images
- Set up networking
- Configure SSL certificates
- Start all services
Monitor Deployment
Watch the deployment logs in real-time:
- Click on the deployment in progress
- View build and startup logs
- Wait for “Deployment successful” message
Understanding docker-compose.coolify.yml
Cap provides a Coolify-specific compose file:docker-compose.coolify.yml
docker-compose.yml:
- Uses environment variable placeholders (no defaults)
- Configured for Coolify’s networking
- Optimized for Traefik reverse proxy
- Includes health checks for zero-downtime deploys
Configure Email
Add email support to send login links:Get Resend API Key
- Sign up at resend.com
- Verify your domain
- Create an API key
Add AI Features
Storage Configuration
The Coolify deployment uses MinIO by default. For production:Option 1: Coolify Persistent Storage (Default)
Coolify creates Docker volumes for:- MySQL data
- MinIO data (videos)
Option 2: External S3
For better reliability, use external S3:
See S3 Storage for provider-specific guides.
Updates & Redeployment
Manual Update
Automatic Updates
Enable automatic deployments on git push:- Go to project Settings
- Enable Automatic Deployment
- Choose deployment trigger:
- On git push to branch
- On webhook
- Scheduled (cron)
For stability, we recommend manual updates for production.
Monitoring
Service Logs
- Click on service (e.g., cap-web)
- Click Logs
- View real-time logs or filter by time
Resource Usage
Coolify shows:- CPU usage per service
- Memory usage
- Network traffic
- Container status
Health Checks
Coolify monitors health check endpoints:- Cap Web:
http://127.0.0.1:3000/ - Media Server:
http://localhost:3456/health - MySQL: Built-in health check
- MinIO: Built-in health check
Backups
Database Backup
Create scheduled backup:MinIO Backup
If using Coolify MinIO:For production, external S3 with versioning is more reliable than manual backups.
Scaling
Vertical Scaling
Increase resources for a service:- Click service in Coolify
- Go to Resource Limits
- Set:
- Memory limit (e.g., 4GB)
- CPU limit (e.g., 2 cores)
- Restart service
Horizontal Scaling
Coolify supports Docker Swarm for multi-container scaling:- Convert Coolify to Swarm mode
- Scale services:
Troubleshooting
Service Won’t Start
- Check logs for errors
- Verify environment variables are set
- Check if ports are available
- Restart service in Coolify UI
SSL Certificate Issues
- Verify domain DNS points to Coolify server
- Check Traefik logs:
- Ensure ports 80 and 443 are open
- Manually trigger certificate renewal in Coolify
Database Connection Errors
- Check if MySQL service is running
- Verify
DATABASE_URLformat - Check network connectivity:
Out of Disk Space
- Check Docker disk usage:
- Clean up unused images:
- Consider external S3 to save space
MinIO Not Accessible
- Verify MinIO domain is configured
- Check MinIO logs in Coolify
- Test bucket access:
Migration to Coolify
Migrate from Docker Compose or Railway:Advanced Configuration
Custom Traefik Rules
Add custom routing or middleware:- Edit service in Coolify
- Add Traefik labels in Advanced section
- Example for rate limiting:
Connect to External Database
Use managed database service:- Remove MySQL from docker-compose.coolify.yml
- Update
DATABASE_URL: - Redeploy
Multiple Environments
Deploy staging and production:- Create two Coolify projects: “Cap Production” and “Cap Staging”
- Use different branches:
- Production:
main - Staging:
develop
- Production:
- Use different domains
- Configure separate environment variables
Next Steps
Email Setup
Configure email with Resend
S3 Storage
Switch to external S3
Environment Variables
Complete configuration reference
Troubleshooting
Common issues and solutions