Installation with Docker Compose
The fastest way to a running instance is docker compose. The file compose.yml in the
repository starts five services:
| Service | Job |
|---|---|
web |
the application |
worker |
background work: mail, notifications, AI |
db |
PostgreSQL 17 with the vector extension |
redis |
live updates (Valkey) |
caddy |
HTTPS with an automatic certificate |
Data lives in four volumes: the database, uploaded files, the Rails cache and Caddy's
certificates. web and worker share the cache; it needs no backup.
Get the repository
git clone https://github.com/lalabase/lalabase.git
cd lalabase
git checkout "$(git tag --list '[0-9][0-9][0-9][0-9].[0-9]*.[0-9]*' --sort=-v:refname | head -1)" # the latest release
cp .env.docker.example .env
Install a release, not main. Releases are numbered by date (2026.11.1), and
main is what our hosted service runs, also between two releases. What changes from
release to release is in CHANGELOG.md.
Fill in .env
.env.docker.example explains every value. Required are:
| Variable | Content |
|---|---|
LALABASE_HOST |
your instance's address without https://, e.g. tickets.example.org |
SECRET_KEY_BASE |
openssl rand -hex 64 |
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY |
openssl rand -hex 32 |
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY |
openssl rand -hex 32 |
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT |
openssl rand -hex 32 |
POSTGRES_PASSWORD |
openssl rand -hex 24 |
If one of them is missing, docker compose does not start at all and names the missing
variable. For mail, add your SMTP settings as well (see
environment variables).
Store the five generated values outside the server as well, for example in your password manager. Without the three encryption values, stored AI keys and repository tokens stay unreadable, in every backup too. A new SECRET_KEY_BASE signs everyone out and has further effects worth knowing when moving or cloning a server.
Start
First point the DNS record of LALABASE_HOST at your server and open ports 80 and 443.
Caddy fetches a certificate from Let's Encrypt on the first start.
docker compose up -d
docker compose ps
The first start pulls the image of the release you checked out
(ghcr.io/lalabase/lalabase:<release>, for x86_64 and ARM) and creates the database. The reference
data (the global chat personas) is loaded once along the way. It creates no accounts and
deletes nothing. On every later start, web applies pending migrations itself.
If the very first start aborts after the schema was loaded, a restart does not load the
reference data. Load it once by hand then: docker compose exec web bin/rails db:seed.
Start web once, not scaled to several containers: it creates the database when it starts.
Building the image yourself
For a change of your own you can build the image from your checkout instead of pulling it.
Put this line into .env, so that every docker compose command uses the build file too:
COMPOSE_FILE=compose.yml:compose.build.yml
Then start with docker compose up -d --build; the first build takes a few minutes. Build
the image on the server it runs on: native extensions do not carry over between ARM and
x86_64.
Create the first admin
A fresh instance has no admin yet. Create the first one with this command:
docker compose exec web bin/rails lalabase:setup
The command asks for an email address and a password in the terminal. Without a terminal, for example in a script, pass both as environment variables:
docker compose exec \
-e LALABASE_ADMIN_EMAIL=admin@example.org \
-e LALABASE_ADMIN_PASSWORD='a-long-password' \
web bin/rails lalabase:setup
- The password needs at least 12 characters.
- If the values are missing and there is no terminal, the command stops with a message.
- If an admin exists already, the command refuses. You manage further admins in the admin area.
Then sign in at /admin. The command itself creates no organisation and no user account, so
create the first one in one of two ways:
- In the admin area under
/admin/users/new, with a new organisation. This needs no mail: the account counts as confirmed, and its temporary password appears once in the message after saving. - Through the registration at
/users/sign_up, which needs working mail (see below).
Your own reverse proxy instead of Caddy
If a proxy of your own (Traefik, nginx) already terminates TLS, delete the line
COMPOSE_PROFILES=tls from .env. Caddy then does not start, and your proxy forwards to
127.0.0.1:3000. The port is reachable locally only on purpose: nobody from outside should
reach the application past TLS. If 3000 is taken, set another one with LALABASE_PORT in .env.
The proxy has to pass the original address on, or Lalabase refuses every page with 403. For
nginx, put proxy_set_header Host $host; into the location block, because nginx otherwise
sends 127.0.0.1:3000 as the host. If your proxy itself runs in a container, it cannot reach
the server's 127.0.0.1: attach it to the compose project's network and forward to
web:3000.
The proxy also has to send the visitor's address in X-Forwarded-For (nginx:
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;, Traefik and Caddy do it
themselves). Lalabase limits sign-ins and other requests per address. Without the header
every visitor counts as the proxy, and the failed attempts of one person lock out everyone.
Lalabase does not read a Forwarded header.
Trying it on your own computer
For a trial without a domain and a certificate, follow Try it locally.
Without a mail server
Registration sends a confirmation link. Without working mail the registration still succeeds and the account works at once, but the link never arrives, and after three days sign-in is blocked. People you create in the admin area, and people you invite, need no such link.