Skip to Content
ContributeEnvironment Variables

Environment Variables

Local development configuration for the backend, frontend, and Celery workers. For the full catalog — every variable, what it means, and whether it is required — see the Environment Variables reference. This page covers only what differs for local dev.

Generate the dev files

Run once from the repository root:

terminal
./rh dev init
./rh dev up

./rh dev init writes apps/backend/.env and apps/frontend/.env.local, each starting with # Generated by ./rh dev init. ./rh dev up starts Postgres and Redis on dev ports (11000 / 11001). Do not commit real secrets.

The init files set local values for the same variables the deployment reference describes — DB_HOST=localhost, DB_PORT=11000, loopback API_BASE_URL / FRONTEND_URL / BACKEND_URL, and generated DB_ENCRYPTION_KEY, JWT_SECRET_KEY, and SESSION_SECRET_KEY. The defaults in that reference are Docker-Compose defaults (postgres, redis, /app/storage), so they differ from these local values.

To use Rhesis-hosted models locally, add a RHESIS_API_KEY from app.rhesis.ai  to apps/backend/.env; otherwise point the DEFAULT_*_MODEL variables at a provider whose key you set. See LLM access.

Frontend

./rh dev init writes apps/frontend/.env.local with API_BASE_URL, BACKEND_URL, FRONTEND_URL, a generated NEXTAUTH_SECRET, and NEXT_TELEMETRY_DISABLED=1.

Two variables point at the backend because it’s reached from two places: API_BASE_URL is used by browser code, while BACKEND_URL is used for server-side rendering and the /api/* proxy. In local dev both are http://localhost:8080; they diverge only behind a reverse proxy or across containers. Values are read at container start, so changing a URL needs no rebuild.

Celery workers

Workers use the same PostgreSQL connection, DB_ENCRYPTION_KEY, BROKER_URL / CELERY_RESULT_BACKEND, and JWT_SECRET_KEY as the backend. Inject the same logical configuration as apps/backend/.env through your process manager or container orchestration rather than maintaining a second variable list.