Getting Started with Nebu

This guide walks you through setting up a local Nebu development environment from scratch.

Prerequisites

ToolVersionWhy
Docker Desktop4.x+Runs all services in containers
makeAnyRuns dev targets
gitAnyClone the repository

No local Elixir or buf installation is needed. All builds run inside Docker containers.


1. Clone and Initial Setup

make setup does two things:

  • Generates .secrets/internal_secret (32-byte random hex, the PSK for node registration) if absent
  • Prints the dev OIDC credentials (Dex local users, see step 4 below)

The .secrets/ directory is in .gitignore - never commit it. If you need a custom POSTGRES_PASSWORD, copy .env.example to .env manually before make dev.


2. Start the Stack

This runs docker compose up and starts:

ServiceURLPurpose
Nebu (Matrix API + Admin UI)http://localhost:8008Main endpoint for clients
Dex (OIDC provider)http://localhost:5556Dev identity provider
PostgreSQLlocalhost:5432Database (user: nebu, db: nebu)
MinIOhttp://localhost:9001S3-compatible media storage (dev)

Wait until you see Nebu.Application started in the server logs:


3. Dex hostname (no setup needed)

Dex (the development OIDC provider) is configured with the public hostname dex.localtest.me, which resolves to 127.0.0.1 via the well-known *.localtest.me wildcard DNS convention — no /etc/hosts edit is required on a machine with normal internet DNS access.

Most common failure on a home network: DNS-rebind protection in consumer routers (e.g. AVM Fritz!Box, on by default in Germany/EU) blocks public hostnames from resolving to loopback/private IPs. Check with:

It should print 127.0.0.1. If it prints nothing, DNS-rebind protection (or an air-gapped/VPN network) is the cause — see the fallback below. Note the asymmetry: this only affects your HOST machine/browser. The containers themselves are unaffected, since they resolve dex.localtest.me via the Docker Compose network alias (docker-compose.yml), not public DNS — so docker compose logs looking healthy while your browser fails to resolve the hostname is expected, not a sign of a broken stack.

If DNS resolution fails for any reason (DNS-rebind protection, air-gapped network, VPN blocking external wildcard domains), add this fallback instead:


4. Bootstrap Wizard

Open http://localhost:8008/admin in your browser.

If this is a fresh installation (empty database), you will be redirected to the Bootstrap Wizard. Complete the following steps:

Step 1 - Server Name: Enter a server name (e.g., localhost). This becomes part of all Matrix user IDs (@user:localhost). It cannot be changed after setup without a full data migration.

Step 2 - OIDC Provider: Enter the development Dex configuration:

FieldValue
OIDC Issuerhttp://dex.localtest.me:5556/dex
Client IDnebu-gateway
Client Secretnebu-dev-secret
Role Claim Namenebu_role

Step 3 - First Login: You will be redirected to Dex. Log in with one of the pre-configured dev users:

EmailPasswordRole
kai@example.comchangemeinstance_admin
compliance@example.comchangemecompliance_officer
alex@example.comchangemeuser

Log in as kai@example.com for the first admin setup.

After login, you will be redirected to the Admin Dashboard. Bootstrap mode is now permanently disabled.


5. Connect a Matrix Client

Element Web

  1. Open https://app.element.io (or a self-hosted instance)
  2. Click Sign In → Edit (to change server)
  3. Under "Other homeserver", enter: http://localhost:8008
  4. Click Continue → you will be redirected to Dex for SSO login
  5. Log in with alex@example.com / changeme

You are now connected as a Matrix user on your local Nebu instance.

Create a test room: Click the + next to "Rooms" → give it a name → Create.

Test messaging: You can log in with a second account in a separate browser profile or incognito window and join the same room.


6. Common make Targets

TargetDescription
make setupGenerate secrets and dev credentials (run once, then again after make clean)
make devStart full stack via docker compose
make test-unit-elixirRun Elixir unit tests in container
make test-integrationFull stack + Playwright/Gherkin integration tests
make test-perfOpt-in performance-budget tests (tag :perf, e.g. the 200-client /sync latency budget); not part of make test-integration
make build-serverCompile Elixir app inside the build container (mix compile)
make redeployRebuild the server Docker image and recreate the container

7. Troubleshooting

"Server not ready" or 502 errors on first start

Cause: The Elixir server takes ~30s to start (OTP release compilation + DB migrations).

Fix: Wait for the server health check to pass:


"dex.localtest.me: connection refused" or DNS lookup failure during OIDC login

Cause: No DNS/internet access to resolve the *.localtest.me wildcard (it should resolve to 127.0.0.1 with zero configuration on a normal internet connection). The most common cause on a home network is DNS-rebind protection in consumer routers (e.g. AVM Fritz!Box — on by default in Germany/EU), which deliberately blocks public hostnames from resolving to loopback/private IPs to prevent DNS-rebinding attacks. Less commonly: a fully air-gapped environment, or a corporate VPN/DNS resolver that blocks external wildcard domains.

Diagnose:

Should print 127.0.0.1. If it prints nothing, DNS resolution (not the Nebu stack) is the problem — note this only affects your HOST machine/browser; the containers resolve dex.localtest.me fine via the Docker Compose network alias and are unaffected, so a healthy docker compose ps/logs output does not rule this out.

Fix (fallback only — try disabling VPN first, or disabling your router's DNS-rebind protection for *.localtest.me if it supports an allowlist):

Then retry. If you are in a corporate VPN, the VPN may intercept DNS - disable VPN for local dev.


Bootstrap Wizard does not appear; I see a login page

Cause: The database already has a bootstrap_active=false entry (previous setup).

Fix: Reset the database:


Element asks to set up keys, secure backup or device verification

Expected behavior. Nebu supports the client-side E2EE infrastructure: device keys, cross-signing keys, server-side key backup (room_keys), to-device messages and device verification. Element and FluffyChat may therefore ask you to set up a recovery key or verify a device; that works. The server stores only public keys and opaque blobs, so keep your recovery key safe: Nebu cannot recover it.

Rooms are not end-to-end encrypted and cannot be: Nebu refuses m.room.encryption and m.room.encrypted so that archive, audit log and legal export stay complete (ADR-011). Do not turn on "Enable end-to-end encryption" in room settings; the server answers 403 M_FORBIDDEN. End-to-end encrypted Element Call calls are not supported either.

If a setup dialog does not close, reload the page and try again.


PostgreSQL migration fails on startup

Cause: Database schema version mismatch (downgrade attempted, or .secrets/ was regenerated without clearing the database).

Fix:

Source: README.md, §Quick Start; CLAUDE.md, §Commands; _bmad-output/planning-artifacts/architecture.md, §Build-Container-Strategie