---
title: Coolify
description: Deploy your own Dagr server on Coolify with the existing Docker Compose stack.
---

# Deploy on Coolify

Use this when you already have a [Coolify](https://coolify.io) server and want a public Dagr API and web UI. Coolify can run the same Compose file you use locally. It builds the API and the browser client, starts Postgres, Redis, and MinIO, and runs migrations before the API comes up.

Size the Coolify server like a single Compose host. See [recommended resources](/hosting#recommended-resources).

For a local try, use [Quick start](/quickstart). To run Compose on a machine without Coolify, see [Self-hosting](/hosting/self-hosting).

After the stack is up, open the **client** domain in a browser, or sign in from the desktop app with **Self-hosted** and the API URL. See [Web app](/hosting/web-app) and [Sign in](/desktop/sign-in).

## What Coolify starts

| Piece | In the Compose file | Notes |
| --- | --- | --- |
| API | `dagr` | Public HTTPS through Coolify’s proxy |
| Web UI | `client` | Static nginx app. Attach its own domain on port `80` |
| Migrations | `migrate` | Runs once, then exits |
| Postgres | `postgres` | Keep this private |
| Redis | `redis` | Keep this private |
| MinIO | `minio` | Optional for a first try (uploads are not wired yet) |
| Bucket setup | `createbuckets` | Creates the `dagr` bucket, then exits |

The image includes `/dagr` and `/dagr-worker`. Compose starts the API only. See [Worker](/hosting/worker) if you want scheduled messages, link previews, and outbound email.

## 1. Add the repository

In a Coolify project, add a new resource from Git. Use [github.com/kilobyteno/dagr](https://github.com/kilobyteno/dagr) or your fork.

- Build pack: **Docker Compose**
- Docker Compose location: `/deploy/docker-compose.yml`
- Base directory: `/` (so the image builds from the repository root)

Coolify should list `dagr`, `client`, `postgres`, `redis`, `minio`, `migrate`, and `createbuckets`.

## 2. Domain and ports

Give a domain (or Coolify’s generated hostname) to **`dagr`** on port `8080` and to **`client`** on port `80`. Coolify’s proxy terminates TLS.

Do not attach a public domain to Postgres, Redis, or MinIO.

The Compose file publishes host ports for local use (`8080`, `4173`, `5433`, `6379`, `9000`). On Coolify, the proxy is enough. If deploy fails because a host port is already taken, remove or comment those `ports:` entries in a fork, or let Coolify’s Compose editor drop the host mappings for everything except what you truly need.

## 3. Environment

Open **Environment Variables** on the resource. Values you set here override the defaults in the Compose file. Change the database and MinIO passwords before anyone else can reach the server.

Set at least:

```bash
HTTP_ADDR=:8080
SERVER_ID=my-dagr
```

After you know the public URLs:

```bash
PUBLIC_BASE_URL=https://YOUR_WEB_APP_HOST
SERVER_PUBLIC_URL=https://YOUR_API_HOST
```

Invite and verification links use `PUBLIC_BASE_URL` (the web app origin). Set these Coolify build arguments on **`client`** so the UI talks to your API:

```bash
VITE_DAGR_DEFAULT_MODE=selfhosted
VITE_DAGR_SELF_HOSTED_URL=https://YOUR_API_HOST
```

Those `VITE_*` values are baked in at image build time. Rebuild `client` if the API hostname changes. See [Web app](/hosting/web-app).

Leave `DEPLOYMENT_MODE` unset so the server stays self-hosted (no payment plans).

For a longer-lived server, set `SERVER_SIGNING_PRIVATE_KEY` (base64 Ed25519 seed). If you leave it empty, the key changes on every restart.

Email is optional. `EMAIL_PROVIDER=log` writes messages to logs. To send real mail, see [Email](/hosting/email).

If you change `POSTGRES_PASSWORD` or MinIO keys, update `DATABASE_URL`, `S3_ACCESS_KEY`, and `S3_SECRET_KEY` on the `dagr` and `migrate` services so they still match.

## 4. Deploy

Click **Deploy**. Wait until `migrate` has finished and `dagr` and `client` are running.

The API image is distroless: it has no `curl` inside the container. If Coolify marks `dagr` as unhealthy while the site works, turn off Coolify’s HTTP health check for that service (or point it at `GET /api/v1/health` from the proxy, not from a command inside the container).

`client` answers `GET /healthz`. Point Coolify’s HTTP health check there if you enable one.

## 5. Try it

```bash
curl -s https://YOUR_API_HOST/api/v1/health
# {"status":"ok"}
```

Open `https://YOUR_WEB_APP_HOST` in a browser, or the desktop app with **Self-hosted** and `https://YOUR_API_HOST`.

## Worker

Compose on Coolify starts the API only. To run `/dagr-worker`, see [Worker](/hosting/worker). You can skip it for a first look.

## Suggested order

1. Add the Git resource with Compose path `/deploy/docker-compose.yml`
2. Attach a domain to `dagr` on port `8080` and to `client` on port `80`
3. Set `VITE_DAGR_SELF_HOSTED_URL` and `VITE_DAGR_DEFAULT_MODE=selfhosted` on `client`
4. Override default passwords
5. Deploy
6. Set `PUBLIC_BASE_URL` to the web app host and `SERVER_PUBLIC_URL` to the API host, then redeploy
7. Sign in from the browser or the desktop app
