Skip to main content
The demo entrypoint serves the real dashboard and API over a seeded data directory of fictional apps, deploy history, databases and nodes. It never talks to Docker, never opens ingress or agent ports, and rejects every write on the server, so it is safe to put in front of strangers. It is a separate subcommand. A normal instance ignores APP_DEMO_MODE and logs a warning, so a stray variable can never turn a real install into a demo.

Seed the data

  • --seed picks the deterministic data set. The same seed and anchor always produce the same rows.
  • --anchor sets the “now” the 14 days of history are counted back from (RFC 3339, default the current hour).
  • --scenario picks the storyline: incident (default, the public demo with a crashlooping app, pending approvals and a firing disk alert) or calm (a healthy fleet with succeeded deploys only and at most one pending approval, used for marketing screenshots). Unknown values are rejected.
  • Seeding refuses a data directory that already holds users, and re-running with the same options is a no-op.
To refresh the time anchor, seed into a new empty data directory and swap it in.

Serve it

serve fails closed. It exits with an error unless all of these hold:
  • APP_DEMO_MODE is set to a true value.
  • The data directory carries the seeder’s marker and holds only seeded users.
  • DOCKER_HOST, APP_AGENT_ADDR, APP_INGRESS_HTTP_ADDR and APP_INGRESS_HTTPS_ADDR are all unset.
  • APP_HTTP_ADDR, if set, is a loopback address. The default is 127.0.0.1:8080.
Put your own reverse proxy or tunnel in front of the loopback port. For a Caddy based public host see Host a public read-only demo. Set APP_DEMO_RESET_INTERVAL (a duration such as 30m, at least one minute) if your host re-seeds more often than daily; the banner then shows the matching next reset time.

Run it as a container

deploy/demo/container-entrypoint.sh seeds a fresh temporary data directory and then runs levelrail demo serve, so every container start is a clean demo. Set these variables on the container:
  • APP_DEMO_MODE=1 (the script sets it if missing).
  • APP_DEMO_CONTAINER=1 permits a non-loopback bind, and only when a container is detected (/.dockerenv, /run/.containerenv or a container runtime in the PID 1 cgroup). Outside a container the variable is refused with an error. A normal instance never reads it. The opt-in means “running in a container”, not “isolated”: it adds no network or filesystem isolation of its own. On Kubernetes, detection can fail on containerd pods that have no /.dockerenv, and then the opt-in is refused.
  • APP_HTTP_ADDR is optional. With the opt-in inside a container the default is 0.0.0.0:8080.
  • DEMO_SEED picks the data set (default 1).
  • APP_DEMO_RESET_INTERVAL (for example 30m) makes the script exit after that time. Use restart: always (or --restart=always) so the runtime starts a new container that reseeds.
Every other check still applies: DOCKER_HOST, APP_AGENT_ADDR and the ingress addresses must be unset, and the data must be seeded-only. The demo also refuses to start when /var/run/docker.sock or /run/docker.sock exists, with or without the opt-in, so never mount the Docker socket. Mount nothing else from the host either.
APP_DEMO_RESET_INTERVAL must be digits followed by h, m or s and at least 60 seconds; anything else exits with status 2. Exposure rules, because the container binds all interfaces:
  • Use either no -p at all (reach it only through a reverse proxy on a user-defined Docker network) or -p 127.0.0.1:8080:8080 as above. Never publish it as a bare -p 8080:8080.
  • docker run -p bypasses UFW and most host firewall rules, so a firewall is not a substitute for the loopback prefix.
  • Never use --network host.
  • A --read-only root filesystem with a tmpfs /tmp is recommended. It is untested with this entrypoint, so verify it starts before relying on it.
  • Login rate limits key on the connecting address. Behind a proxy, configure the proxy to pass the real client address, or every visitor shares the proxy’s limit.

What visitors can do

Visitors sign in as a read-only account, either through the one-click demo session or with the credentials shown on the login form. Sessions last two hours.
  • Every route that is not on a short allowlist returns 403 with the JSON code demo_readonly. The allowlist holds sign-in, sign-out and a few pure computations such as spec validation.
  • Routes that would reach a host or a third party (terminal, exec, node provisioning, update checks, Git provider flows, exports, downloads, AI chat) return 403 with the code demo_disabled.
  • API tokens, the auth library endpoints and WebSocket upgrades are refused.
  • Every response carries X-Robots-Tag: noindex, nofollow and /robots.txt disallows everything.
GET /api/v1/demo reports whether demo mode is on, when the data resets, and the install command to show in a banner. It returns {"enabled": false} on a real instance.

Human check

POST /api/v1/demo/session accepts an optional human check through the api.HumanVerifier interface and rate limits session creation per client IP. The built-in server ships without a verifier; enforce a challenge at your edge, or supply one when embedding the router.

What it does not do

  • It does not run the reconciler, collectors, builds, backups, ingress or the self-updater.
  • It does not simulate deploys or rollbacks. Those buttons return demo_readonly.

Host it on a small box

The deploy/demo/ directory holds a hardened, generic layout. The demo binary listens on loopback only and a tunnel such as cloudflared dials out to it, so no inbound port is open and no reverse proxy is needed.
What gets installed:
  • A levelrail-demo system user, the binary under /opt/levelrail-demo, state under /var/lib/levelrail-demo and an env file at /etc/levelrail-demo/env.
  • levelrail-demo.service, which allows only loopback traffic (IPAddressDeny=any), drops all capabilities, mounts the system read-only and caps memory, CPU and tasks.
  • levelrail-demo-reseed.timer, a nightly re-seed that re-anchors the 14 days of history. It seeds into a new directory and swaps it in.
  • levelrail-demo-tripwire.timer, hourly. It re-seeds if the apps, databases or users tables differ from the seed, or if a non-GET request succeeded outside the allowlist in the unit’s journal.
Copy cloudflared-config.yml.example and cloudflared-demo.service.example for the tunnel, and replace the placeholder hostname. To take the demo down, systemctl stop levelrail-demo.
Last modified on November 17, 2026