# Self-host Umami

> Web and product analytics platform that records page views and events without cookies, with a dashboard; self-hostable on Node.js and PostgreSQL. Run your own Umami on an always-on EnvHaven workspace by asking its coding agent: one request installs it, puts it on an HTTPS address and locks it down. What the agent takes care of, and the manual route.

_Updated November 23, 2026_

Running your own Umami usually means a list of server chores: a machine that stays on, Docker or a runtime, a reverse proxy with certificates, a domain, and the settings that make Umami behave behind all of it. On an EnvHaven workspace you skip the list. You ask the coding agent, and it does the work while you watch.

## Just ask your agent

Open a Plus workspace (Umami runs in Docker, which Plus and Pro include), tap **Launch** to start any coding agent (Claude Code, Codex, OpenCode or another), and ask it:

```text
Set up Umami on this workspace and give me the link. Follow https://envhaven.com/self-host/umami.md
```

Then open the link it sends and create your Umami account straight away, before anyone else finds the address. That is the whole request: the address in it is this page's Markdown copy, and the agent follows the instructions for it further down, with every setting Umami's docs require.

## Or keep it private with Tailscale

The preview URL puts Umami on the public internet, which suits something other people need to reach. For an app only you and your household use, your tailnet is the better home: Tailscale gives Umami an HTTPS address that only your own devices, signed in to your Tailscale account, can open. Save a Tailscale auth key in the workspace's **Vars** pane as `TS_AUTHKEY`, and ask the agent:

```text
Set up Umami on my tailnet instead of the preview URL. Follow https://envhaven.com/self-host/umami.md and https://envhaven.com/guides/self-host-privately-with-tailscale.md
```

- A Tailscale container runs beside Umami, so it keeps its private address through workspace restarts and updates, and every app you set up this way gets an address of its own.
- Anything other services have to reach, such as a webhook, still needs a public address. [Keep self-hosted apps private with Tailscale](https://envhaven.com/guides/self-host-privately-with-tailscale) covers both, and what Tailscale's free plan includes.

| At a glance |  |
| --- | --- |
| What it is | Databases, backends and analytics |
| License | MIT |
| Runs as | Docker (`ghcr.io/umami-software/umami (docs also name docker.umami.is/umami-software/umami)`) |
| Memory | Not documented |
| Plan that fits | Plus or larger |
| Web port | 3000 |
| Documentation | [umami.is/docs/install](https://umami.is/docs/install) |

## What your agent takes care of

- **Installing it.** Umami runs from the official image, `ghcr.io/umami-software/umami (docs also name docker.umami.is/umami-software/umami)`, with its data in folders under `~/apps/umami`.
- **Putting it on an HTTPS address.** The workspace's preview URL serves it, and your own domain can too.
- **Locking it down first.** What Umami's docs say to set before it faces the internet, below.
- **Telling you what to back up**: PostgreSQL database (Docker volume umami-db-data in the compose file) and the .env file (DATABASE_URL, APP_SECRET, TWO_FACTOR_ENCRYPTION_KEY) ([docs](https://github.com/umami-software/umami/blob/master/docker-compose.yml)).

### The settings it needs behind a proxy

- No public-URL variable: Umami has no ROOT_URL-style setting; behind a proxy it needs the client-IP settings below. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- `CLIENT_IP_HEADER`: Header that carries the visitor IP when the proxy uses a non-standard one (for example CF-Connecting-IP). ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- `TRUSTED_PROXIES` (v3.5.0): Addresses of the proxies in front of Umami; X-Forwarded-For is then read right to left, skipping trusted proxies. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- `TRUSTED_PROXIES` default behaviour: Without it Umami takes the leftmost X-Forwarded-For entry, which a client can forge. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- `BASE_PATH` (build time): Hosts Umami under a subdirectory; baked in at build, so a prebuilt image cannot use it; the proxy must handle the prefix. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- `FORCE_SSL` (build time): Sends a Strict-Transport-Security header on all responses. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- `TRACKER_SCRIPT_NAME` and `COLLECT_API_ENDPOINT`: Rename the public tracker script (default script.js) and collection endpoint (default /api/send) to dodge ad blockers. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- Cloudflare location headers: Proxy CF-IPCountry, CF-Region-Code and CF-IPCity only from a trusted Cloudflare connection. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/enable-cloudflare-headers.mdx))
- HOSTNAME and PORT: Bind address and port when started with pnpm run start:env. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/install.mdx))

### Before it faces the internet

- A default account admin with password umami is created on first start; v3.5.0 and later force a password change at first login, but change it before exposing the instance. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/install.mdx))
- APP_SECRET is required (no fallback since v3.5.0); each install needs its own value, and changing it signs everyone out. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- The compose file ships a placeholder two-factor key that must be replaced before anyone enables 2FA. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- The compose file ships the database password umami (database not published to the host). ([docs](https://github.com/umami-software/umami/blob/master/docker-compose.yml))
- Only list your own proxy addresses in TRUSTED_PROXIES. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- The login page can be disabled entirely. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))

## Things to ask next

Everything after the install is one more sentence to the agent. Some that come up:

- "Create the tables for a simple CRM: companies, contacts and deals."
- "Seed it with sample data so I can try the interface."
- "Move Umami to app.example.com." Add the domain on the dashboard's Domains page with a CNAME to `domains.envhaven.app`, and the agent changes Umami's address settings to match.
- "Update Umami to the latest release." It pulls the new image and recreates the container, data kept.

## Instructions for the agent

The agent reads these from the page's Markdown copy. They also work pasted on their own, if you would rather give them in your own words.

```text
Set up Umami on this workspace and serve it at my preview URL.
- Use Docker Compose with the official image, ghcr.io/umami-software/umami (docs also name docker.umami.is/umami-software/umami), starting from the docs' compose file: https://github.com/umami-software/umami/blob/master/docker-compose.yml. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- The docs' setup includes: PostgreSQL 15 (postgres:15-alpine), included in the compose file; Redis is optional (REDIS_URL), off by default.
- Keep the compose file in ~/apps/umami and all of its data in folders there (bind mounts, not named volumes), with restart: unless-stopped on every service.
- This server has no firewall, so publish no port on its public IP, and drop host networking and privileged mode from the docs' compose file. Docker runs on the host: connect this workspace to the compose network and relay my preview URL's port to Umami's port 3000.
- The preview URL terminates HTTPS in front of Umami: serve plain HTTP on its port, and trust the forwarded headers the relay passes on.
- Set what "The settings it needs behind a proxy" lists on https://envhaven.com/self-host/umami.md for the preview URL, as Umami's docs describe for running behind a proxy; skip any that apply only when Umami serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/umami.md.
- When it answers at the preview URL, send me the link and tell me what to back up.
- If I asked for my tailnet instead of the preview URL, set Umami up the same way but follow https://envhaven.com/guides/self-host-privately-with-tailscale.md for the network: no preview URL, no relay.
```

## What to know

- In Docker, Umami's containers keep running when the workspace restarts or updates. The relay from the preview URL is a process in the workspace, so after a restart or an update, ask the agent to restore it.
- BASE_PATH is a build-time variable, so serving the prebuilt image under a path needs a custom image build. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- Telemetry and update checks make outbound calls by default; PRIVATE_MODE disables all external calls (and website icons). ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- Anonymous telemetry is on unless DISABLE_TELEMETRY is set. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- Without a CDN that sets location headers Umami falls back to a local GeoIP database that is downloaded at build time. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- The tracker script and /api/send endpoint are small HTTP calls (no large uploads), but ad blockers often block them. ([docs](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx))
- A workspace has one preview URL and one custom domain, both serving the same port, so it puts one app on a public address at a time.

## Without a workspace

The manual route, on a server you run:

1. Rent a Linux VPS, secure SSH, and create a user for the app.
2. Install Docker and write a compose file from the official image.
3. Put a reverse proxy in front (Caddy, nginx or Traefik), get certificates, and point a domain at the server.
4. Set the proxy settings listed above for that domain, and pass WebSocket upgrades through the proxy if the app uses them.
5. Keep the firewall closed except for the proxy, and schedule backups and updates.

Umami's own [documentation](https://umami.is/docs/install) covers each step for its install methods.

## Sources

Facts about Umami come from its own documentation, checked on 2026-11-23:

- [umami.is/docs/install](https://umami.is/docs/install)
- [github.com/umami-software/docs/blob/master/content/docs/install.mdx](https://github.com/umami-software/docs/blob/master/content/docs/install.mdx)
- [github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx](https://github.com/umami-software/docs/blob/master/content/docs/environment-variables.mdx)
- [github.com/umami-software/docs/blob/master/content/docs/enable-cloudflare-headers.mdx](https://github.com/umami-software/docs/blob/master/content/docs/enable-cloudflare-headers.mdx)
- [github.com/umami-software/umami/blob/master/docker-compose.yml](https://github.com/umami-software/umami/blob/master/docker-compose.yml)

## Keep reading

- [Self-host any app with your agent](https://envhaven.com/self-host)
- [Self-host Supabase](https://envhaven.com/self-host/supabase)
- [Self-host Appwrite](https://envhaven.com/self-host/appwrite)
- [Self-host NocoDB](https://envhaven.com/self-host/nocodb)
- [Self-host Baserow](https://envhaven.com/self-host/baserow)
- [AI agent hosting](https://envhaven.com/guides/ai-agent-hosting)

Source: https://envhaven.com/self-host/umami
