---
title: "How to self-host Umami in 2026: its Compose file, one command and HTTPS | Pethost"
description: "Self-host Umami analytics with its own Docker Compose file: set two secrets, run pethost deploy, get HTTPS, Postgres and nightly backups for €9.99 a month."
---

[Blog](https://pethost.dev/blog/) · Deploy guides

# How to self-host Umami in 2026: its Compose file, one command and HTTPS

By the Pethost team · 10 October 2026 · 7 min read

You want Umami's analytics on a server of your own, with its Postgres, at an address with HTTPS, and without setting up a proxy or certificates. Umami ships a Docker Compose file, and on Pethost a Compose file is a project. Put your own secrets into it, as Umami asks, and run `pethost deploy`. Umami and its database started in 1 minute 27 seconds, at an address the deploy gave by itself.

**In short**

- **The file is Umami's own:** `docker-compose.yml` from its repository, with Umami and Postgres 15.
- **One edit, the one Umami asks for:** put your secrets in place of the file's two placeholders. Nothing is changed for Pethost: the `ports` lines stay.
- **One command:** `pethost deploy`. The machine finds the web port the file publishes and serves it at `https://umami.yourname.pethost.app`.
- **The data stays:** Postgres keeps it in a volume that the nightly backup includes. A new version of Umami is one changed tag and one deploy.
- **The price:** €9.99 a month for a machine of 2 vCPU, 3 GB and 30 GB. Umami and Postgres took about 220 MB of its memory. There is no free tier.

## What you need to self-host Umami in 2026

Three things: Umami's Compose file, the `pethost` command and a Pethost account.

**The file** is in Umami's repository. Put it into a folder of its own, whose name becomes the project's name:

```
mkdir umami && cd umami
curl -O https://raw.githubusercontent.com/umami-software/umami/master/docker-compose.yml
```

**The command** is one program, installed by one line. Every command it has is in the [CLI's reference](https://pethost.dev/docs/cli/).

```
curl -fsSL https://pethost.dev/install.sh | sh      # macOS, Linux
irm https://pethost.dev/install.ps1 | iex           # Windows, in PowerShell
```

**The account** needs a plan. If you are not signed in, `pethost deploy` opens your browser and signs you in. If you have no plan yet, it shows you where to choose one, and waits.

## Set Umami's two secrets in docker-compose.yml

The service `umami` begins like this in the file:

```
services:
  umami:
    image: ghcr.io/umami-software/umami:latest
    ports:
      - "3000:3000"
    environment:
      DATABASE_URL: postgresql://umami:umami@db:5432/umami
      APP_SECRET: replace-me-with-a-random-string
      # Required for two-factor authentication, generate with: openssl rand -hex 32
      TWO_FACTOR_ENCRYPTION_KEY: replace-me-with-a-64-character-hex-string
```

Run `openssl rand -hex 32` twice and put one result in place of each placeholder. They stay in the file, so every later deploy starts Umami with the same ones. This is Umami's own step, the same on any server.

Nothing else in the file changes, the `ports` lines included. The database's volume, the health checks and `depends_on` run as Umami wrote them.

## Deploy Umami with pethost deploy

Run `pethost deploy` in the folder. This is the whole screen:

```
$ pethost deploy
Name it [umami]:    it will live at https://umami.sam.pethost.app

✓ Packed 1 file, 1 KB
✓ Uploaded straight to your machine
✓ Started in 1 min 27 s
  · deployed docker-compose.yml as compose.yaml
✓ umami listens on 3000 → https://umami.sam.pethost.app
  It answers 200.

https://umami.sam.pethost.app

Wrote .pethost (commit it). Next:   pethost logs -f   ·   pethost open
```

The file publishes port 3000 of `umami`. Once the service listened, the machine asked that port what it is, got an answer in HTTP, and gave it the project's address. So the port is served over HTTPS at that address and is not opened on the machine beside it: we tried `http://` the machine's address on port 3000, and nothing answered. A second project whose file writes `3000:3000` too gets its own address the same way, and the two never meet.

Postgres publishes no port, so it has no address and nothing of it is open: only Umami reaches it, by the name `db`. This is the project after the deploy:

```
$ pethost
umami · https://umami.sam.pethost.app
db	healthy	since 2026-10-10T16:15:47Z	listens on 5432	memory 38 MB
umami	healthy	since 2026-10-10T16:15:53Z	listens on 3000	memory 180 MB
2 services run · last deploy succeeded 2026-10-10T16:16:09Z
```

## Sign in and add your website

Open the address. A new Umami has one account, the username `admin` with the password `umami`. Sign in and change that password before anything else. Then add your website in Umami's settings and put its tracking script on your pages. The script comes from your own address:

```
<script defer src="https://umami.sam.pethost.app/script.js" data-website-id="…"></script>
```

We asked the deployed Umami what a browser asks. The login page, `/api/heartbeat` and `/script.js` each answered 200, and the default account signed in.

To use a name of your own, such as `stats.example.com`, run `pethost domain add stats.example.com umami:3000`. It prints the one DNS record to make, a CNAME to your machine's name, and the certificate comes by itself once the name resolves.

## Where the Umami data is, and how it is backed up

Umami keeps accounts, websites and every pageview in Postgres, and the Compose file gives Postgres a volume. The machine keeps that volume through restarts and deploys, and the nightly backup includes it:

```
$ pethost volume
umami (.pethost)
umami-db-data	47 MB	db:/var/lib/postgresql/data	backed up 2026-10-10T16:18:48Z
```

We restarted the project with `pethost restart` and signed in again with the same account. `pethost backup` lists the snapshots, and `pethost backup restore` puts one back. For a look into the database from your laptop, `pethost tunnel db` brings its port to `localhost` without opening it to anyone else.

## Update Umami to a new version

The file's tag is `latest`. To choose the moment of an update yourself, name a version in `docker-compose.yml` and deploy again. We went from 3.3.1 to 3.4.0 this way:

```
image: ghcr.io/umami-software/umami:3.4.0
```

```
$ pethost deploy
umami (.pethost)
✓ Packed 2 files · uploaded · started in 17 s
  · deployed docker-compose.yml as compose.yaml
  · kept the project's x-pethost
  It answers 200.
https://umami.sam.pethost.app
```

The address stayed, the data stayed, and the account signed in as before. Read Umami's release notes first, and take a snapshot with `pethost backup now` before a large update: a rollback puts the earlier Compose file back, and a volume's data is not part of a version.

## What you get for the price

Pethost is €9.99 a month for everything you host, on 2 vCPU, 3 GB of memory and 30 GB of disk. Umami and its Postgres took about 220 MB of that memory, so the same machine has room for the sites Umami counts and for your other projects, such as an [RSSHub](https://pethost.dev/blog/self-host-rsshub/) beside it. There is [no fee per project](https://pethost.dev/blog/unlimited-projects-flat-monthly-fee/), and the database is [part of the same price](https://pethost.dev/blog/european-hosting-postgres-flat-price/). Nothing is metered by pageview.

- **€9.99** a month for the whole machine
- **1 min 27 s** to pull and start Umami and Postgres
- **220 MB** of memory for both

What is already done on it: HTTPS with certificates that renew themselves, nightly backups kept for 14 days, SSH into any container, and a Compose project that [runs from its own file](https://pethost.dev/blog/managed-docker-compose-hosting/). The machine is in the EU and always on, so the tracking script [never waits for a cold start](https://pethost.dev/blog/always-on-hosting-no-cold-starts/). The plans are on the [pricing](https://pethost.dev/#pricing) part of the first page.

**What each project takes.** The capacity page: every project with its memory, CPU and disk.

![The Pethost panel's capacity page: each project with its memory, CPU and disk.](https://pethost.dev/shots/capacity.webp)

### Pethost is the best pick for

- **People who want their analytics on their own server**, without looking after the server
- **Solo developers** with several sites to count and one bill to pay
- **People whose agent deploys for them**: Claude Code or Codex deploys the Compose file and reads its logs
- **Small teams** who keep their visitors' data in the EU

### Look elsewhere if

- Your sites have so many visitors that the analytics need a database cluster of their own

## Questions

### Can I self-host Umami with Docker Compose without a server to manage?

Yes. On Pethost Umami's own `docker-compose.yml` is the project: set its two secrets and run `pethost deploy`. The deploy gives Umami an address with HTTPS by itself, and the proxy and the backups are already there.

### Do I have to change the ports in Umami's Compose file?

No. The file publishes port 3000, and it stays as written. The machine asks a published port what it is: one that answers HTTP, as Umami's does, is served at the project's address over HTTPS and is not opened on the machine. A published port of something else, such as a database, opens on the machine as the file writes it.

### What is the default Umami login after a new install?

The username `admin` and the password `umami`. Change the password in Umami as soon as you have signed in.

### How much memory does self-hosted Umami need?

On our test machine Umami 3.4.0 took 180 MB and its Postgres 38 MB, with no traffic yet. A Starter machine has 3 GB.

### How do I update self-hosted Umami?

Change the image's tag in `docker-compose.yml` to the new version and run `pethost deploy`. The data in Postgres stays: we went from 3.3.1 to 3.4.0 this way and signed in as before.

### What does it cost to self-host Umami on Pethost?

€9.99 a month for the Starter machine of 2 vCPU, 3 GB and 30 GB, with no fee per project and nothing counted per pageview: the same machine runs your sites and other apps. There is no free tier. Prices are without VAT.

The screens are deploys of the Compose file in Umami's repository, with Umami 3.4.0, Postgres 15.19 and pethost 0.2.2, on a test machine of ours. The account in them is the example one, `sam`.

1. [Umami: installation](https://umami.is/docs/install)
2. [Umami: docker-compose.yml](https://github.com/umami-software/umami/blob/master/docker-compose.yml)
3. [Umami: login](https://umami.is/docs/login)
4. [pethost, the command line of Pethost](https://pethost.dev/docs/cli/)

## Put your projects online today

A machine of your own, as many projects as fit, one flat price. Nothing metered, nothing billed on top.

[Host all your projects for €9.99/mo](https://console.pethost.dev/)

## Keep reading

- 25 September 2026 [Hosting providers with an official MCP server in 2026: deploy, logs and rollback compared](https://pethost.dev/blog/hosting-with-mcp-server/) 18 of 19 hosting platforms have an official MCP server in 2026. Two have a rollback tool. Pethost's 13 tools deploy, read logs, roll back and restore.
- 16 September 2026 [Hosting for AI coding agents in 2026: let Claude Code or Codex deploy and debug production](https://pethost.dev/blog/hosting-for-ai-coding-agents/) To let Claude Code or Codex deploy and debug production alone, a host must give the agent five things. Pethost does, with 13 MCP tools, from €9.99 a month.
- 27 September 2026 [European hosting for an app with Postgres at a flat monthly price in 2026: what €10 a month buys](https://pethost.dev/blog/european-hosting-postgres-flat-price/) An app with Postgres in the EU at a flat monthly price is €9.99 on Pethost: a 3 GB machine for every project that fits. Eleven hosts, priced.
- 21 September 2026 [Hosting with unlimited projects for one flat monthly fee in 2026: a price per machine, not per app](https://pethost.dev/blog/unlimited-projects-flat-monthly-fee/) Hosting priced per machine runs as many projects as fit for one flat monthly fee. Six small apps: €9.99 on Pethost, $30 on Railway, $42 on Render.

[All articles](https://pethost.dev/blog/) · [About Pethost](https://pethost.dev/about/) · [Pricing](https://pethost.dev/#pricing)

Pethost · Stephan Gomer · NIP 1133096755

[Home](https://pethost.dev/) [About](https://pethost.dev/about/) [Blog](https://pethost.dev/blog/) [Terms](https://pethost.dev/terms/) [Privacy](https://pethost.dev/privacy/) [Refunds](https://pethost.dev/refunds/) [support@pethost.dev](mailto:support@pethost.dev)
