Skip to content

Coolify

LeafLock ships with a docker-compose.coolify.yml that Coolify understands out of the box. Follow these steps to bring the app online without repeating what other pages already explain.

  • Coolify 4.x installed with Docker access
  • Git repository containing this project (or a fork)
  • Domain pointed at your Coolify host if you want HTTPS
  • Shell access to generate secrets with openssl
  1. In Coolify, choose New Resource → Docker Compose → From Git Repository.
  2. Point it at your LeafLock repo and branch.
  3. Set Compose file to docker-compose.coolify.yml (no build command needed).
  4. Give the project a name (for example leaflock) and assign your domain if you have one.

Coolify will now watch the repository and rebuild whenever you redeploy.

Step 2 – Configure Environment Variables

Section titled “Step 2 – Configure Environment Variables”

Add the following variables in the Environment tab before the first deploy. Values shown here are examples—replace them with secrets you generate yourself.

Terminal window
# PostgreSQL
POSTGRES_PASSWORD=$(openssl rand -base64 32)
DATABASE_URL=postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/notes?sslmode=prefer
# Redis
REDIS_PASSWORD=$(openssl rand -base64 32)
REDIS_URL=redis:6379
Terminal window
# Security
JWT_SECRET=$(openssl rand -base64 64)
SERVER_ENCRYPTION_KEY=$(openssl rand -base64 32)
# HTTP + CORS
PORT=8080
CORS_ORIGINS=https://leaflock.example.com
VITE_API_URL=https://leaflock.example.com/api/v1
# App behaviour
APP_ENV=production
ENABLE_REGISTRATION=false
ENABLE_DEFAULT_ADMIN=true
DEFAULT_ADMIN_EMAIL=admin@leaflock.example.com
DEFAULT_ADMIN_PASSWORD=$(openssl rand -base64 24)LeafLock!

Add any optional flags (metrics, additional admins, etc.) exactly as you would for other deployments. Keeping everything in Coolify’s environment editor makes redeploys painless.

Hit Deploy. Coolify will:

  1. Pull the repository
  2. Build the images defined in docker-compose.coolify.yml
  3. Start PostgreSQL → Redis → backend → frontend
  4. Run the configured health checks

You should see all services turn green once the containers finish booting.

Run these checks from your workstation:

Terminal window
# Frontend should serve the app
curl -I https://leaflock.example.com/
# Backend health endpoint should respond with JSON
curl https://leaflock.example.com/api/v1/health

If you use a custom domain, confirm that Coolify issued a certificate and that CORS_ORIGINS matches the URL you expect your users to visit.

  • Pull upstream changes, then trigger redeploys from Coolify.
  • Rotate the secrets above on a schedule—Coolify keeps previous values so you can roll them back if needed.
  • Watch container logs inside the Coolify UI when debugging issues.
  • For platform-specific problems, check the dedicated Troubleshooting section.

That’s it—no secondary “setup” document required.