Skip to content

Environment variables

The variables Shellius reads, which ones are secrets, and which ones you cannot afford to lose.

Shellius is configured through the environment. The example files in the repository are the canonical list: .env.example for development and .env.prod.example for production. The exhaustive table, including defaults, lives in docs/DEPLOYMENT.md.

This page covers the ones that matter most.

Secrets you must generate ​

Every one of these should be unique per deployment. Shellius refuses to start if they are left at their example values.

VariableGenerate withPurpose
JWT_SECRETopenssl rand -hex 32Signs access tokens
JWT_REFRESH_SECRETopenssl rand -hex 32Signs refresh tokens
SERVER_ENCRYPTION_KEYopenssl rand -hex 32Encrypts the CA private key and stored credentials
AGENT_SHARED_SECRETopenssl rand -hex 32Authenticates hosts calling the verification endpoint
METRICS_TOKENopenssl rand -hex 16Guards the Prometheus endpoint
POSTGRES_PASSWORDany strong valueDatabase password

DANGER

SERVER_ENCRYPTION_KEY is the one you cannot lose. It encrypts your certificate authority's private key at rest. Without it the CA is unrecoverable and every bootstrapped host must be re-bootstrapped against a new one. Store a copy somewhere other than the server it runs on.

Changing JWT_SECRET or JWT_REFRESH_SECRET invalidates every existing session, which is a useful thing to do deliberately after a suspected compromise.

URLs and networking ​

VariableNotes
TRAEFIK_HOSTThe hostname Shellius is served at
FRONTEND_URLThe public URL of the portal
CORS_ORIGINMust match the origin the browser actually uses, scheme and port included

Getting FRONTEND_URL or CORS_ORIGIN wrong is the most common cause of a deployment where sign-in appears to work but every subsequent request fails.

First-run seeding ​

VariableNotes
SEED_ADMIN_EMAILThe first super admin
SEED_ADMIN_PASSWORDChange it from the portal straight after first sign-in

Seeding is idempotent, so it is safe across restarts.

Email ​

Transactional email covers invitations, password resets, access request notifications, certificate expiry warnings, and email verification. Configure SMTP through the variables listed in docs/smtp-configuration.md. Without it, Shellius still runs, but nobody gets notified when a production request needs approval — which defeats much of the approval workflow.

Single sign-on ​

OIDC can be configured either through environment presets or per-organisation in the database, where credentials are stored encrypted. See docs/sso-configuration.md.

Was this page helpful?No, tell us why