| name | coolify |
| description | Coolify self-hosted PaaS: deploy apps and databases on your own server, Docker/Git-based deploys, preview environments, wildcard SSL, free alternative to Heroku/Railway |
Coolify Skill
When to activate
- Self-hosting a PaaS on a VPS (Hetzner, DigitalOcean, Vultr) using Coolify
- Deploying Docker Compose, Dockerfile, or Git-based apps without Kubernetes
- Setting up managed PostgreSQL, Redis, or MongoDB on your own infrastructure
- Creating preview deployments from Git branches or PRs
- Migrating from Heroku, Render, or Railway to a self-hosted solution
- Configuring wildcard SSL with Let's Encrypt on a custom domain
When NOT to use
- Managed cloud where you don't control the server (use Railway/Vercel/Fly.io)
- Teams that need SOC2 compliance from the hosting provider
- Workloads requiring auto-scaling beyond vertical scaling
Why Coolify for vibe coding
Coolify is the open-source Heroku. You own the infrastructure, pay only for the VPS (~$6/month on Hetzner), and get a full PaaS experience: one-click databases, automatic SSL, Git deployments, preview environments, and a web dashboard. It eliminates deployment friction without vendor lock-in — making it ideal for AI-generated codebases that need production hosting fast.
Instructions
Installation on a VPS
ssh root@your-server-ip
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
Recommended VPS specs:
- Minimum: 2 vCPU, 4GB RAM (Hetzner CX22 ~$5/month)
- Production: 4 vCPU, 8GB RAM (Hetzner CX32 ~$10/month)
Deploying an app
From a Git repository:
- Dashboard → New Resource → Application
- Connect GitHub/GitLab repo
- Select branch (e.g.
main)
- Coolify auto-detects: Dockerfile, Nixpacks (Node.js, Python, Ruby, Go)
- Set environment variables
- Deploy
From a Dockerfile:
# Coolify reads this automatically from your repo root
FROM node:22-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]
Docker Compose:
version: '3.8'
services:
app:
build: .
environment:
DATABASE_URL: ${DATABASE_URL}
ports:
- "3000:3000"
depends_on:
db:
condition: service_healthy
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: myapp
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
retries: 5
volumes:
postgres_data:
Managed databases
- Dashboard → New Resource → Database
- Select: PostgreSQL 16, Redis 7, MySQL, MongoDB, etc.
- Coolify provisions on your server with:
- Persistent volume
- Internal connection string (within your network)
- Optional: expose on external port with credentials
DATABASE_URL=postgresql://postgres:password@coolify-db:5432/myapp
Environment variables
DATABASE_URL=postgresql://postgres:secret@coolify-db-uuid:5432/myapp
REDIS_URL=redis://:secret@coolify-redis-uuid:6379
JWT_SECRET=your-secret-here
NODE_ENV=production
Preview deployments (PR environments)
- Application → Source → Enable Preview Deployments
- Each PR/branch gets its own deployment
- Wildcard domain:
*.myapp.coolify.my-server.com
- Auto-cleanup when branch/PR is closed
preview:
enabled: true
domain: preview.myapp.com
database:
cloneFromProduction: true
Custom domains and SSL
Deployment webhooks (trigger deploys from CI)
curl -X POST "${{ secrets.COOLIFY_WEBHOOK_URL }}" \
-H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}"
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Trigger Coolify deploy
run: |
curl -X POST "$COOLIFY_WEBHOOK" \
-H "Authorization: Bearer $COOLIFY_TOKEN"
env:
COOLIFY_WEBHOOK: ${{ secrets.COOLIFY_WEBHOOK_URL }}
COOLIFY_TOKEN: ${{ secrets.COOLIFY_TOKEN }}
Health checks
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
export async function GET() {
try {
await db.execute('SELECT 1')
return Response.json({ status: 'ok', db: 'connected' })
} catch {
return Response.json({ status: 'error', db: 'disconnected' }, { status: 503 })
}
}
Backup and restore
Coolify vs Railway
| Feature | Coolify | Railway |
|---|
| Cost | VPS cost (~$6-10/mo) | Usage-based (~$5-20/mo) |
| Control | Full server access | Managed |
| Setup time | 10 minutes | 2 minutes |
| Scaling | Vertical (manual) | Automatic |
| Best for | Cost-sensitive, high control | Speed, simplicity |
Example
User: Self-host a Next.js + PostgreSQL app on a Hetzner VPS using Coolify with preview deployments for PRs and automatic SSL.
Expected output:
Dockerfile — Next.js standalone build
coolify.yaml — preview deployments enabled
app/health/route.ts — health check endpoint
- GitHub Actions workflow triggering Coolify webhook on main push
- Step-by-step: install Coolify → add GitHub repo → link PostgreSQL → configure domain → enable previews