Installation
Legend is self-hosted, which means you run it on infrastructure you control. This page walks through a standard container deployment using Docker Compose behind a reverse proxy with TLS. The exact image names, tags, and any release-specific settings are in the deployment notes that ship with your version, so treat the values below as a working template rather than fixed constants.
Requirements
- A host you control: a virtual machine or server with a modern 64-bit Linux is a safe default.
- A container runtime with Docker Engine and the Docker Compose plugin installed.
- A database for Legend to store your map. PostgreSQL is a common, well-supported choice.
- A DNS name pointing at the host, for example legend.example.com, so you can serve it over TLS.
- A reverse proxy such as Caddy, Nginx, or Traefik to terminate TLS and forward traffic to the app.
- If you are on a paid plan, the license key from the customer portal. The Community tier needs no key.
Step 1: Prepare the host
- Provision the host and point your DNS name at its public address.
- Install Docker Engine and the Compose plugin using your distribution’s official instructions.
- Create a working directory for the deployment, for example /opt/legend, and change into it.
Confirm the tooling is present before continuing:
docker --versiondocker compose version
Step 2: Create a Docker Compose file
Create a file named docker-compose.yml in your working directory. The example below runs the application and a PostgreSQL database. Replace the image reference, the passwords, and the domain with your own values.
services:legend:image: your-registry/legend:latest # use the tag from your release notesrestart: unless-stoppeddepends_on:- dbenvironment:DATABASE_URL: postgres://legend:change-me@db:5432/legendAPP_URL: https://legend.example.comSECRET_KEY: replace-with-a-long-random-stringports:- "3000:3000" # forwarded to by the reverse proxydb:image: postgres:16restart: unless-stoppedenvironment:POSTGRES_USER: legendPOSTGRES_PASSWORD: change-mePOSTGRES_DB: legendvolumes:- legend-db:/var/lib/postgresql/datavolumes:legend-db:
The environment variable names above are illustrative. Use the exact names your release documents; the important idea is that Legend needs a database connection string, a public URL, and a secret for signing sessions.
Step 3: Start the stack
- From your working directory, start the services in the background.
- Watch the logs until the application reports that it is ready to accept connections.
docker compose up -ddocker compose logs -f legend
Step 4: Put a reverse proxy in front with TLS
Do not expose the application port directly to the internet. Put a reverse proxy in front to terminate TLS and forward requests to the app. Caddy is a simple option because it obtains and renews certificates automatically.
A minimal Caddyfile that proxies your domain to the app looks like this:
legend.example.com {reverse_proxy localhost:3000}
With Nginx or Traefik the idea is the same: terminate TLS at the proxy, forward to the application port, and forward the standard proxy headers so the app knows its external URL and the client protocol.
Step 5: Create the first admin account
- Open https://legend.example.com in a browser.
- On the first-run screen, create the initial administrator account with a strong, unique password.
- If you are on a paid plan, open settings and paste in your license key. The Community tier runs without one.
- Confirm you can sign in, then continue with the Quick Start to add your first entities.
Screenshot: the reverse proxy serving Legend over HTTPS, with the first-run administrator setup screen visible in the browser.
Deploy anywhere
The same approach works on a single server, a container platform, or a managed Kubernetes cluster. The pieces are always the application, a database, a secret, a public URL, and TLS in front. Pick the environment that matches how your team already deploys software, and use the deployment notes for your release for exact commands and version details.