HAIMDALL reads its settings from environment variables. With Docker Compose, set them in a .env file next to docker-compose.yml, or in your shell before starting it. Never put them inside the image. On Node.js hosting, set them in your host's control panel, or in a .env file in the HAIMDALL folder (see Installing on Node.js Hosting).
Required
SESSION_SECRET— the key that signs sign-in sessions. Use a long random value, for example the output ofopenssl rand -base64 48. HAIMDALL won't sign anyone in without it. Changing it signs everyone out.POSTGRES_PASSWORD— the password of the database in the Compose file, used both to create the database and in HAIMDALL's connection to it. Choose a strong one: HAIMDALL refuses to start with a default or obvious database password.DATABASE_URL— required on Node.js hosting. With Docker, only if you use your own PostgreSQL server instead of the Compose database, for examplepostgres://haimdall:<password>@db.example.internal:5432/haimdall. The Compose file sets this for you otherwise.
PostgreSQL reads POSTGRES_PASSWORD only when it first creates its data volume. To change the password of an existing database, change it inside PostgreSQL (ALTER USER postgres PASSWORD '…') and then update the variable.
Optional
HAIMDALL_DATA_DIR(default: thedatafolder inside the app;/app/datain the Docker image) — where HAIMDALL keeps uploaded files and the interface text. On hosts that replace the app folder when you deploy, set it to a folder outside the app folder, or uploads are lost at the next deploy. HAIMDALL creates it if it's missing. Leave it alone with Docker.HAIMDALL_SETUP_CODE— a code of your own (at least 12 characters) for creating the first administrator on the sign-in page of a new installation. Without it, HAIMDALL makes one up at each start and writes it to the log and tosetup-code.txtin the data folder. It stops working once the first account exists.HAIMDALL_IMAGE(defaulthaimdall:latest) — which HAIMDALL image to run, for examplehaimdall:0.1.0. Change it to upgrade (see Upgrading HAIMDALL).HAIMDALL_PORT(default3000) andPOSTGRES_PORT(default5432) — the ports HAIMDALL and the database are published on, on this server only. Change them if those ports are already in use.HAIMDALL_BIND_ADDRESS(default127.0.0.1) — the address HAIMDALL's port is published on. Leave it alone when the reverse proxy runs on this server. When the proxy runs on another machine, set it to this server's internal address (for example10.0.0.5) and firewall port 3000 so that only the proxy can reach it. See HTTPS and Reverse Proxy › Make the proxy the only way in.MIGRATE_ON_START— HAIMDALL sets up and updates its database every time it starts. Set this to0only if your database administrator applies HAIMDALL's database changes separately.
Example .env
SESSION_SECRET=replace-with-the-output-of-openssl-rand-base64-48
POSTGRES_PASSWORD=replace-with-a-long-random-password
TRUST_PROXY_HOPS=1
HAIMDALL_PUBLIC_URL=https://help.example.comKeep this file readable only by the people who run the server: it holds the secrets that protect every account.