Skip to Content
Firstline/Docs

Overview

What a self-hosted Firstline install is made of, and which parts you actually need.

A Firstline install is one Linux server running Docker and Coolify. Coolify deploys the Firstline services from the GitHub repository. Each service is its own Docker Compose stack in the repository root (docker-compose.*.yml), and you add each one to Coolify as a separate resource.

What self-hosting supports today

Self-hosted installs currently support the web app. The iOS app and its offline sync aren't yet supported on self-hosted servers. Staff notifications for self-hosted installs are in progress.

Services

ServiceWhat it doesCompose fileSelf-hosted
Web appThe EMR itself: patient charts, messaging, admin dashboard and the APIdocker-compose.web.ymlRequired
PostgreSQL 17Stores all EMR recordsNot in a compose file. Create it as a Coolify database, or use an external oneRequired
Object storage (RustFS)Patient photos, audio notes and documentsdocker-compose.object-storage.ymlRequired. On the server, or an external S3-compatible service
Notifications serverThe patient-facing Telegram bot (intake forms, doctor–patient messaging)docker-compose.notifications.ymlOptional
Video calls (LiveKit)In-app video callingdocker-compose.livekit.ymlOptional
TranslationArabic → English message translationdocker-compose.translation.ymlOptional (needs ~2 GB RAM)
Admin SSO (Zitadel)Single sign-on in front of the admin consoles belowdocker-compose.auth.ymlOptional
Database browser (Drizzle Studio)Read and query the database from the browser, for adminsdocker-compose.analytics.ymlOptional (uses Admin SSO)
Offline sync (PowerSync)Keeps the iOS app working offlinedocker-compose.powersync.ymlNot yet supported

A minimal install is the web app + PostgreSQL + object storage. Add the rest when you need those features. Requirements lists the server resources each service uses.

Zitadel is not how your staff log in

Staff sign in to Firstline through the web app's own login, which includes passkeys and two-factor authentication. Zitadel only adds single sign-on in front of the admin consoles (the database browser and the storage console). You can skip it on a minimal install.

How traffic flows

                 Internet (HTTPS :443)
                          │
               ┌──────────▼──────────┐
               │  Coolify proxy      │   Caddy: TLS certificates + routing
               │  (Caddy)            │   by domain name
               └──┬───────┬───────┬──┘
                  │       │       │
       app domain │  s3.  │       │ optional: livekit., identity.,
                  │       │       │ analytics., storage-admin.
          ┌───────▼──┐ ┌──▼─────┐ └──► optional services
          │ Web app  │ │ RustFS │
          └────┬─────┘ └────────┘
               │
          ┌────▼────────┐
          │ PostgreSQL  │   private: never exposed to the internet
          └─────────────┘

Every service joins Coolify's shared Docker network (coolify), so services reach each other by name (for example web and rustfs-server) without going through the internet.

Domains you'll need

You need a domain you control. Firstline uses one domain for the app and subdomains for the other services:

HostnameUsed byNeeded
Your app domain, e.g. emr.example.orgWeb appAlways
s3.Object storage API (browsers and phones load media from it)If you run object storage on the server
livekit.Video callsIf you use video
identity.ZitadelIf you use Admin SSO
analytics., storage-admin.Admin consolesIf you use Admin SSO
A dashboard domain, e.g. coolify.example.orgThe Coolify dashboardRecommended

Some config still assumes firstline.care

A few compose files and settings still have firstline.care written into them, rather than reading it from an environment variable. The service guides will cover exactly what to change for your domain.

First boot

When the web app starts against an empty database, it shows a setup page. There you can start fresh or import a Firstline backup file.

The first account to sign up becomes the admin

On a fresh install, the first person to sign up is automatically approved and made an administrator. Sign up yourself right after the first deploy, before you share the URL with anyone.

On this page