Documentation
Installation / Install with Coolify

Install with Coolify

Run Uptime Kotlin and PostgreSQL as a Coolify service, with your domain, HTTPS and generated secrets.

Coolify deploys the same two containers as the Docker Compose installation, and adds the domain, the HTTPS certificate and the secrets for you. You need a server already connected to Coolify v4.

Create the service

In your project, choose + New, then Docker Compose Empty, and paste this definition:

YAML
services:
  uptime-kotlin:
    image: ghcr.io/theomeunier/uptime-kotlin:latest
    restart: unless-stopped
    mem_limit: 512m
    environment:
      - SERVICE_URL_UPTIMEKOTLIN_8080
      - TZ=${TZ:-Europe/Paris}
      - QUARKUS_DATASOURCE_USERNAME=${SERVICE_USER_POSTGRES}
      - QUARKUS_DATASOURCE_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
      - QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://postgres:5432/uptime-kotlin
      - ENCRYPTION_MASTER_KEY=${SERVICE_PASSWORD_64_MASTERKEY}
      - MP_JWT_VERIFY_ISSUER=https://issuer.uptime-kotlin.com
    depends_on:
      postgres:
        condition: service_healthy

  postgres:
    image: postgres:18.6-alpine
    restart: unless-stopped
    environment:
      - POSTGRES_DB=uptime-kotlin
      - POSTGRES_USER=${SERVICE_USER_POSTGRES}
      - POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
    volumes:
      - uptime-kotlin-db:/var/lib/postgresql
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -U $${POSTGRES_USER} -d uptime-kotlin']
      interval: 5s
      timeout: 5s
      retries: 10

volumes:
  uptime-kotlin-db:

There are no ports: the Coolify proxy reaches the application on port 8080, set by the SERVICE_URL_UPTIMEKOTLIN_8080 variable. Coolify fills every SERVICE_ variable when the service is created:

Variable Generated value
SERVICE_URL_UPTIMEKOTLIN_8080 A URL on your wildcard domain, routed to port 8080.
SERVICE_USER_POSTGRES The PostgreSQL user, shared by both containers.
SERVICE_PASSWORD_POSTGRES The PostgreSQL password, shared by both containers.
SERVICE_PASSWORD_64_MASTERKEY A 64-character ENCRYPTION_MASTER_KEY.

Set the domain

Open the uptime-kotlin container of the service and enter your domain, keeping the port at the end, for example https://status.example.com:8080. Point a DNS record for that name at the server: Coolify requests the certificate on the first deployment.

Deploy and sign up

Choose Deploy. Once both containers are running, open your domain: on the first visit, Uptime Kotlin asks for the administrator account, as described in Create the first account.

Save the master key

In Environment Variables, copy the value of SERVICE_PASSWORD_64_MASTERKEY and keep it somewhere safe, outside Coolify. It encrypts the stored secrets, and a lost key cannot be recovered: deleting the service, or the variable, generates a new one. To change it, see Rotate the master key.

Good to know

Moving an existing instance? Replace ${SERVICE_PASSWORD_64_MASTERKEY} with your current key before the first deployment, and load a dump of your database once PostgreSQL is running, as in Upgrade from PostgreSQL 17.

Large exports cut off? Exports can take up to 300 s. Raise the read timeout of the Coolify proxy if they stop early.

The other environment variables are listed on the configuration page. Add them to the uptime-kotlin container in the definition. Next, create your first monitor.

Suggest a change on GitHub