Skip to content

Start

Install LyEve

LyEve runs from two container images, the engine and LyEve Console, against a database you provide. These images are the supported install. See Source code for what is published.

This page covers the choices: which database, how to run the console beside the engine, what production refuses, and how to start before you have every setting. To try LyEve on your laptop first, the Quickstart starts a database and the engine for you.

The engine stores everything in one database:

DatabaseDATABASE_URL starts with
PostgreSQL 15 to 18postgres://
MySQL 8.0.14 or later, or 8.4mysql://
SQL Server and Azure SQLsqlserver://

The engine picks the database from that scheme and creates its tables on first start. If you need a managed database, Deployment covers Supabase and Neon.

Use a dedicated database user. A production engine refuses to start as the database's default superuser (postgres on PostgreSQL, root on MySQL, sa on SQL Server). On PostgreSQL, use sslmode=require unless the database is on a private network. A production engine logs a warning on every start when the connection can run without TLS.

LyEve needs MySQL 8.0.14 or later and is tested on MySQL 8.0 and 8.4. MySQL 9 is not supported yet.

The engine's tables need the utf8mb4_unicode_ci collation. MySQL gives a new database utf8mb4_0900_ai_ci when the statement names no collation, and so does the official container image. On its first start the engine switches the default collation of a database that holds none of its tables yet, so a stock server or container works as it is. The database user needs the ALTER privilege on the database for that. Without it the engine stops and names the statement to run. You can also create the database with the collation yourself:

SQL
CREATE DATABASE lyeve CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

On a database that already holds the engine's tables, the engine never changes the collation, because that would leave its existing tables and its new ones on different collations. When the default differs, it starts and logs the warning "database default collation differs from the engine's tables", with the current collation and the one it wants. The fix the warning names is a database created with utf8mb4_unicode_ci.

The engine also adds parseTime=true to a MySQL URL, and replaces parseTime=false, so the URL needs no options:

mysql://lyeve:password@tcp(db:3306)/lyeve

On SQL Server, turn on read committed snapshot isolation before you take traffic:

SQL
ALTER DATABASE [your_db] SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK IMMEDIATE;
ALTER DATABASE [model] SET READ_COMMITTED_SNAPSHOT ON;

Without it, a read can lose a deadlock against a concurrent write, and the request fails. The engine checks the setting at start and logs these exact statements when it is off. It does not run them, because the first one disconnects every other session on the database, so pick a maintenance window. Setting it on model means a database created later already has it.

Shell
docker run -d --name lyeve-engine \
-e APP_ENV=development \
-e DATABASE_URL="postgres://lyeve:secret@db.example.com:5432/lyeve?sslmode=require" \
-e JWT_SECRET="$(openssl rand -hex 32)" \
-e ENCRYPTION_KEY="$(openssl rand -hex 32)" \
-p 3001:3001 \
-p 3002:3002 \
ghcr.io/lyeve-labs/lyeve-core:latest

Port 3001 serves the Admin API and port 3002 the Content API. The engine refuses to start without DATABASE_URL, JWT_SECRET and ENCRYPTION_KEY, in every environment. APP_ENV defaults to production, which refuses a weak configuration, so the command above sets development for a first run.

The image pulls from GitHub's container registry with no login. If a pull fails, Pull the LyEve images from ghcr.io on the blog gives the fix for each error, and how to pin a tag or a digest.

VariableDefaultPurpose
DATABASE_URLrequiredConnection string for PostgreSQL, MySQL or SQL Server
JWT_SECRETrequiredFallback signing secret, at least 16 characters. Sessions are signed with an Ed25519 key the engine creates on first start and keeps at JWT_KEY_PATH. Outside production, an engine that cannot write that key signs with this secret instead
ENCRYPTION_KEYrequiredKey for encrypting stored secrets. At least 32 characters and different from JWT_SECRET
APP_ENVproductiondevelopment or production
ADMIN_LISTEN_ADDR0.0.0.0:3001Address of the Admin API
API_LISTEN_ADDR0.0.0.0:3002Address of the Content API
LYEVE_LICENSE_KEYemptyYour license token or key. Empty runs the free tier. See Licensing and tiers
LYEVE_PLUGINSemptyComma-separated list of features to start. Empty starts every feature your license covers
LYEVE_SETUP_TOKENemptyA setup token you choose, 16 characters or more. Set it when more than one replica runs. The Quickstart explains why

Configuration lists every variable.

With APP_ENV unset or production, the engine also requires:

VariableRequirement
SECURE_COOKIEtrue, so session cookies are only sent over HTTPS
RATE_LIMIT_RPSA per-client request ceiling above zero. Unset turns the limiter off, which production refuses
LYEVE_AUDIT_HMAC_KEYExactly 64 hex characters. Generate one with openssl rand -hex 32
JWT_EXPIRY_SECS3600 or less
LYEVE_CONSOLE_URLAn https address when set

A refused start prints every problem at once. The Production checklist covers the rest of a production setup.

Shell
docker run -d --name lyeve-console \
-e CORE_INTERNAL_URL=http://<engine-host>:3001 \
-e CORE_API_INTERNAL_URL=http://<engine-host>:3002 \
-e ORIGIN=http://localhost:3000 \
-e PORT=3000 \
-p 3000:3000 \
ghcr.io/lyeve-labs/lyeve-console:latest
VariablePurpose
CORE_INTERNAL_URLWhere the console reaches the engine. It sends both /api/admin and /api/v1 calls to this one address, so put a proxy in front of the two engine ports
CORE_API_INTERNAL_URLWhere the console sends the /api/v1 calls it makes itself, such as the ones the API reference page runs: the engine's port 3002 or the proxy in front of it. The console refuses to start without it, because its fallback is the console's own port
ORIGINThe URL you open in the browser. It has to match exactly, or sign-in fails its CSRF check
PORTThe port the console listens on. The default is 3002, which collides with the Content API on a shared host
LYEVE_CONSOLE_KEYOptional. The same value, at least 32 characters, on the engine and the console. The console then signs each call with the browser's address, so sign-in limits count each person rather than the console

Docker Compose runs both images with the proxy already configured, and is the shortest path to a working console.

Open http://localhost:3000. A new install redirects to /setup, which asks for the setup token, then an email address and a password for the first administrator. Step 2 of the Quickstart says where the token is.

The console's setup page asks for the setup token, an email address and a password for the first super admin.

Run the engine and the console together does all of this on your computer with one Compose file, then walks through the console's screens.

You can start the engine before you have decided on its database and secrets. With LYEVE_SETUP_MODE=true, a missing DATABASE_URL, JWT_SECRET or ENCRYPTION_KEY no longer stops the start:

Shell
docker run -d --name lyeve-engine \
-e LYEVE_SETUP_MODE=true \
-p 3001:3001 -p 3002:3002 \
ghcr.io/lyeve-labs/lyeve-core:latest

In setup mode the engine connects to no database and serves only setup:

RequestAnswer
GET /healthz, GET /startup200, so an orchestrator keeps the container running
GET /readyz503 with "mode":"setup", so a load balancer sends it no traffic
GET /api/admin/setup200 with "setup_required":true and "mode":"setup"
GET /api/admin/setup/statusWhat is missing, with the X-Setup-Token header
Anything else503 with the code SETUP_REQUIRED

To see what is missing, you need the setup token: the one the engine writes to its standard error, or LYEVE_SETUP_TOKEN when you set it.

Console v0.28.0

Open the console. The setup page says the engine is missing settings. Paste the token into Setup token and choose Show what to set. The console lists what is missing, with the environment lines and a lyeve.yaml snippet to paste.

Engine API v0.62.0

Shell
curl -H "X-Setup-Token: <token>" http://localhost:3001/api/admin/setup/status

The answer lists each missing setting under missing, with its variable and its YAML key, and carries the lines to paste under env and yaml.

A missing secret comes with a value the engine generated for this start, shown once. Set the values where your deployment keeps them and restart the engine. The setup page then moves on to creating the first administrator, and over the API GET /api/admin/setup reports "setup_required":true without "mode":"setup".

Setup mode covers those three settings only. A production engine still refuses to start on the other checks above, and the error names them. The engine never writes the values anywhere and cannot restart its own container.

Your engine is running. Continue with step 1 of the Quickstart to create the first administrator, get a token and write your first entry.