Install Coolify
Install Coolify, secure the dashboard, switch its proxy to Caddy, and connect it to GitHub.
Coolify is how you'll deploy and manage every Firstline service. This page covers only what a Firstline install needs. For anything else, the Coolify docs are the source of truth.
Have the next 10 minutes free
The first person to open a new Coolify dashboard creates the admin account, and that account has root access to your server. Coolify only accepts that first registration for 10 minutes after it starts, so create your admin account right after the installer finishes.
Run the installer
On the server, as root:
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bashThis installs Docker (if it isn't already installed; see Install Docker),
plus curl, git, jq and openssl. It also creates Coolify's files under /data/coolify and starts
Coolify.
Create the admin account
Open http://<server-ip>:8000 in a browser straight away and register. Use a strong, unique
password, then turn on two-factor authentication in your Coolify profile.
Switch the proxy to Caddy
Coolify ships with Traefik as its reverse proxy. Firstline's compose files are written for Caddy: its services route traffic with Caddy labels, which Traefik ignores. Switch now, while nothing is deployed yet:
- Go to Servers → (your server) → Proxy and select Stop Proxy. Wait for Proxy Exited.
- Select Switch Proxy, confirm, and choose Caddy.
- Select Start Proxy.
Switching proxies later interrupts traffic to every app on the server until each one is redeployed. On a fresh server there's nothing to interrupt, which is why this step comes first.
Give the dashboard its own domain
- Create a DNS
Arecord such ascoolify.example.orgthat points at the server (see Provision a server). - In Coolify, go to Settings → General and set URL to
https://coolify.example.org. It must start withhttps://, and it can't include a path. - Open the new address and check that it loads with a valid certificate.
Use a hostname for the dashboard that no Firstline service uses.
Close the setup ports
Once the dashboard works on its domain, remove 8000, 6001 and 6002 from your provider firewall.
Keep 22, 80 and 443.
Connect Coolify to GitHub
Coolify deploys Firstline from its GitHub repository. Fork kessenma/firstline-emr into your organization's GitHub account first, so you decide when updates reach your server.
Then connect the fork with a GitHub App, which lets Coolify redeploy automatically when you push:
- In Coolify, open Sources → New source → GitHub App.
- Name it. Enter your GitHub organization name only if the fork lives in an organization.
- Under webhook endpoint, choose your instance's URL,
https://coolify.example.org. GitHub has to be able to reach it for automatic deploys to work. - Select Register with GitHub, give the app a unique name on GitHub, and create it. GitHub sends you back to Coolify, which stores the app's credentials.
- Select Install repositories and choose only your Firstline fork.
Treat GitHub App credentials as secrets
The app's client secret, webhook secret and private key give access to your repositories. Coolify stores them for you. Never paste them into docs, tickets or chat. If one leaks, regenerate it in GitHub (Settings → Developer settings → GitHub Apps) and update it in Coolify.
Back up Coolify's secrets
/data/coolify/source/.env holds Coolify's own encryption keys (APP_KEY and others). Without it, you
can't restore Coolify on a new server. Copy it to a password manager or other secure storage off the
server:
# From your own machine
scp root@<server-ip>:/data/coolify/source/.env ./coolify-instance.envDelete the local copy once it's stored safely.
What's next
Coolify is ready. Next you'll deploy the Firstline services into it, starting with the database, object storage and the web app. See Next steps.