Deploy an AI app with Coolify
Coolify is a self-hosted Heroku alternative you run on a single VPS. Push to GitHub, Coolify builds and deploys.
Prerequisites
- +A VPS with 4GB+ RAM and Docker
- +A domain you control
- +GitHub repo with a Dockerfile or supported buildpack
Step-by-Step
- 1
Install Coolify
One install script. SSH into your VPS as root and run it.
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash - 2
Connect a Git source
Add GitHub via the OAuth app flow. Coolify gets webhook access for push-to-deploy.
- 3
Create the application
New Resource > Public Repository or Private. Pick the build pack: Dockerfile is most predictable; Nixpacks is the magic option.
- 4
Configure env vars
Add DATABASE_URL, OPENAI_API_KEY, etc. Mark secrets so they are masked in logs.
OPENAI_API_KEY=sk-... DATABASE_URL=postgresql://... NEXT_PUBLIC_APP_URL=https://app.example.com - 5
Set the domain and deploy
Point your DNS A record at the VPS IP. Add the domain in Coolify - it provisions Let's Encrypt automatically.
- 6
Watch logs and iterate
Tail build and runtime logs from the Coolify UI. Push to main triggers a redeploy on every commit.
Common Pitfalls
- !Disk fills up from old images. Run docker builder prune -f weekly.
- !Skipping the health check means broken deploys go live silently.
- !Wrong Node version. Pin in your Dockerfile or via package.json engines.
DevDigest Academy
Structured AI engineering courses with hands-on labs. Build production-ready apps faster.
What's Next
- ->Add a Postgres service in the same Coolify project for free internal networking.
- ->Set up backups via Coolify's S3 backup feature.
