# Self-hosting overview

Run Cohorly on your own server with Docker Compose: what the stack contains, what you receive under contract, and the order to follow from requirements to upgrades and backups.

Cohorly can run on a server you control. One Docker Compose file starts
PostgreSQL, the API, the error worker, the dashboard and a Caddy proxy that
serves everything on a single domain with automatic HTTPS. Your events, user
profiles and reports stay in your own database.

This guide is for the infrastructure team that installs and operates it. It
starts from an empty Linux host and ends with an instance you can upgrade,
back up and monitor.

## What you receive

Self-hosting is delivered under a contract. With the contract you receive:

- The container images of the server and the dashboard, through a registry
  credential or an offline package. See [Getting the images](/self-hosting/images#getting-the-images).
- A license key that the server checks when it starts. See
  [License key](/self-hosting/images#license-key).

The images do not run without a license key, and they are not published to a
public registry. The Cohorly SDKs and the CLI are open source (Apache-2.0); the
server and the dashboard are not.

## What runs on your host

| Service            | What it does                                                                                                       | Reachable from outside |
| ------------------ | ------------------------------------------------------------------------------------------------------------------ | ---------------------- |
| `caddy`            | Terminates HTTPS, gets and renews the certificate, sends API paths to `server` and everything else to `dashboard`. | Ports 80 and 443       |
| `dashboard`        | The Cohorly web app.                                                                                               | Only through `caddy`   |
| `server`           | The API: event ingestion, queries, accounts, MCP server. It runs database migrations when it starts.               | Only through `caddy`   |
| `error-worker`     | Turns captured exceptions into error issues. Same image as `server`, no port.                                      | No                     |
| `postgres`         | The database.                                                                                                      | No                     |
| `alloy` (optional) | Ships metrics and logs to Grafana Cloud. Off unless you turn on the `monitoring` profile.                          | No                     |

The dashboard talks to the API on the same domain, so there is nothing to
configure between them and no rebuild when the domain changes.

## Follow the guide in order

\`\[
&#x20; {
&#x20;   href: "/self-hosting/requirements",
&#x20;   title: "Requirements and sizing",
&#x20;   description: "Host, ports, domain, and CPU, memory and disk by monthly event volume.",
&#x20; },
&#x20; {
&#x20;   href: "/self-hosting/images",
&#x20;   title: "Images and license key",
&#x20;   description: "How the images and the key reach you, how to load them, what the server refuses.",
&#x20; },
&#x20; {
&#x20;   href: "/self-hosting/install",
&#x20;   title: "Install",
&#x20;   description: "From an empty directory to a running instance and your first account.",
&#x20; },
&#x20; {
&#x20;   href: "/self-hosting/configuration",
&#x20;   title: "Operator settings",
&#x20;   description: "The variables worth knowing, plus SSO, e-mail, blob storage and two-factor.",
&#x20; },
&#x20; {
&#x20;   href: "/self-hosting/upgrade",
&#x20;   title: "Upgrade",
&#x20;   description: "Move to a new version, and what going back means.",
&#x20; },
&#x20; {
&#x20;   href: "/self-hosting/backup",
&#x20;   title: "Backup and restore",
&#x20;   description: "Back up PostgreSQL and blobs, and prove the restore works.",
&#x20; },
&#x20; {
&#x20;   href: "/self-hosting/monitoring",
&#x20;   title: "Monitoring",
&#x20;   description: "Health checks, Prometheus metrics, logs.",
&#x20; },
&#x20; {
&#x20;   href: "/self-hosting/network",
&#x20;   title: "What leaves your network",
&#x20;   description: "Every outbound connection, and which settings switch each one on.",
&#x20; },
]\`

## What this guide does not cover

- Kubernetes and Helm. The supported shape is one host running Docker Compose.
- High availability. There is one database and one API container.
