Skip to content

Environment Variables

The server reads its settings from environment variables when it starts (apps/server/src/config.ts). Change one, then restart the server.

With Docker Compose, put variables in .env; the lines under the virvi service’s environment: win over it. See Docker Compose.

Never commit secret values. The tables describe each secret; they never show one.

Modes

VIRVI_MODE sets the defaults for everything else.

ModeUse it forPresence (real-time rooms)BillingFirst account
single (default)One serverIn memoryOff: every feature unlockedBecomes instance admin
scalableSeveral servers behind a load balancerRedisOff: every feature unlockedBecomes instance admin
cloudThe hosted virvi.io serviceRedisOnNever auto-promoted

cloud is for virvi.io. Self-hosted installs use single or scalable.

Required

VariablesinglescalableDefaultWhat it does
DATABASE_URLRequiredRequirednonePostgres connection string. Without it the server prints FATAL: DATABASE_URL environment variable is required and exits.
JWT_SECRETRequiredRequireddev-secret-change-meSigns every sign-in token. Use a long random string (openssl rand -hex 32). When NODE_ENV=production (always true in the Docker image) or in cloud mode, the server refuses to start without it or with the default. Changing it signs everyone out.
PUBLIC_URLRequiredRequiredhttp://localhost:3010The public origin of this server, such as https://virvi.example.com. Used in uploaded file URLs, OAuth redirects and the API docs’ server URL.
REDIS_URLNot usedRequirednoneRedis for cross-server rooms. The server won’t start in scalable mode without it.
ROOM_SERVER_PATHNot usedOptionalnoneWith several servers behind one address: this server’s own path, such as /n1. Visitors joining a room on this server are sent to PUBLIC_URL’s host plus this path, which your proxy must route to this server only. One path segment. See Scalable mode.
COLYSEUS_PUBLIC_ADDRESSNot usedOptionalnoneOverrides ROOM_SERVER_PATH: the host (and optional path) where visitors reach this server’s rooms, such as rooms-1.example.com, with no https://.

Server and network

VariableDefaultWhat it does
VIRVI_MODEsinglesingle, scalable or cloud. See Modes.
PORT3010HTTP and WebSocket port. Both share it.
WEB_APP_URLPUBLIC_URLOrigin of the dashboard. Used as the domain in wallet sign-in messages and in links Virvi hands out (upload links, pairing links). Set it only if the dashboard is on a different origin.
TRUST_PROXY_HOPS1How many reverse proxies sit between the internet and the server. See TRUST_PROXY_HOPS.
RATE_LIMIT_MAX300Requests per minute per client IP, for /api/ routes only. Dashboard files, uploads and docs don’t count. Sign-in routes have their own, stricter limit.
MAX_UPLOAD_MB100Largest request body, in MB.
LOG_LEVELinfo when NODE_ENV=production, else debugdebug, info, warn or error.
NODE_ENVproduction in the Docker imageproduction makes JWT_SECRET mandatory.
DASHBOARD_DIR./dashboard (/app/dashboard in the image)Folder with the built dashboard. Missing: the server runs API-only.
DOCS_DIR./apps/docs/distFolder with the built docs, served at /docs. Missing: no /docs routes. Relative to the working directory (/app in the image).

TRUST_PROXY_HOPS

The server reads each visitor’s IP address for rate limits, trial limits and analytics. Behind a reverse proxy, the socket’s address is the proxy’s, and the real address is in the X-Forwarded-For header. TRUST_PROXY_HOPS says how many proxy hops to trust in that header.

SetupSet
Clients connect straight to the server (no proxy)0
One proxy in front (nginx, Caddy, Traefik, a load balancer)1 (the default)
Railway2
A CDN in front of your proxy2 (count every hop you control or trust)

Too low: every visitor shares the proxy’s address, so one busy visitor can rate-limit everyone. Too high: visitors can fake their address by sending their own X-Forwarded-For. With no proxy, the default 1 lets them do that, so set 0.

A negative or non-numeric value is treated as 1.

Database

VariableDefaultWhat it does
DATABASE_URLnonePostgres connection string (required).
DB_POOL_MAX10 in single mode, 20 otherwiseMost database connections per server.

Storage

VariableDefaultWhat it does
STORAGE_PROVIDERlocallocal stores uploads on disk. s3 or r2 stores them in an S3-compatible bucket. Any other value stops the server at boot. Unset, it’s local (s3 in cloud mode). Use s3 or r2 when you run more than one server on different machines.
LOCAL_STORAGE_PATH./uploadsFolder for uploads with local. Served publicly at /uploads/. Must be on persistent storage.
PRIVATE_STORAGE_PATHa private folder beside LOCAL_STORAGE_PATHSingle mode only: where scene import sources and builds are kept. Must be outside LOCAL_STORAGE_PATH (the server refuses a path inside it) and on persistent storage.
S3_BUCKETnoneBucket name. Required with s3/r2; the server throws S3_BUCKET is required when using s3/r2 storage on the first upload without it.
S3_REGIONautoBucket region. Use auto for Cloudflare R2.
S3_ENDPOINTnoneEndpoint for R2 or MinIO. Leave unset for AWS S3.
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEYnoneBucket credentials, read by the AWS SDK.
CDN_URLnoneOrigin for public file URLs, such as a custom bucket domain. Without it, URLs are <S3_ENDPOINT>/<bucket>/..., or https://<bucket>.s3.amazonaws.com/... with no endpoint.

Scene import

VariableDefaultWhat it does
SCENE_BUILD_RUNNERoff (fly in cloud mode)Where uploaded scenes are built. off refuses imports. local runs apps/scene-builder/build.mjs on the server with no isolation: development only, and it needs npm install in apps/scene-builder (not in the Docker image). fly starts a one-shot Fly machine per build. Any other value stops the server from starting.
SCENE_IMPORT_S3_URInonePrivate bucket for imports: s3://<key>:<secret>@<host>/<bucket>, or file://<dir>. Single mode falls back to PRIVATE_STORAGE_PATH; scalable mode needs it.
SCENE_BUILD_IMAGEnoneBuild image for fly.
SCENE_BUILD_FLY_APPvirvi-scene-buildsThe Fly app build machines run in.
SCENE_BUILD_FLY_TOKENnoneFly token scoped to the build app only.

Five minutes after it starts, then once a day, the server deletes an import’s files 30 days after the import ended, and deployed files no current or recent (30-day) deployment uses. The import itself stays listed. Nothing to configure.

Sign-in

VariableDefaultWhat it does
JWT_ACCESS_EXPIRY15mAccess token lifetime. Also the life of an in-world scene pass.
JWT_REFRESH_EXPIRY7dRefresh token lifetime.
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRETnoneTurns on “Sign in with Google”. Both must be set.
DISCORD_CLIENT_ID, DISCORD_CLIENT_SECRETnoneTurns on “Sign in with Discord”. Both must be set.
OAUTH_CALLBACK_URLPUBLIC_URLBase for OAuth redirect URIs. Register <base>/api/auth/google/callback and <base>/api/auth/discord/callback with the provider.
ALLOW_UNVERIFIED_PLATFORM_AUTHfalsetrue accepts in-world sign-ins without a verified Decentraland signature. Ignored in cloud mode. For local scene previews only; never set it on a public server.
MIN_DCL_HUD_PROTOCOL0Oldest in-world HUD edit protocol (header x-virvi-hud-protocol) allowed to save edits. Older HUDs get 426 and ask for a redeploy. Leave at 0 unless a release says otherwise.

GET /api/auth/providers shows which OAuth providers are on.

Email

Without SMTP_HOST, no email is sent (password resets, invites); the server logs SMTP not configured, skipping email.

VariableDefaultWhat it does
SMTP_HOSTnoneSMTP server.
SMTP_PORT587SMTP port.
SMTP_USER, SMTP_PASSnoneSMTP credentials.
EMAIL_FROMnoreply@virvi.ioSender address. Set your own.
AR_REPORTS_EMAILnone (support@virvi.io on virvi.io)Where a visitor’s “Report this space” (AR spaces) is emailed. Unset, reports are kept and listed for admins but nobody is emailed.

Guest trials

Signed-out visitors can try Virvi at /try/... (see Try Without an Account).

VariableDefaultWhat it does
TRIALS_ENABLEDfalse (true in cloud mode)true or false. Any other value stops the server from starting.
TURNSTILE_SECRET_KEYnoneCloudflare Turnstile secret for the bot check on new trials. Without it, single and scalable mode skip the check; cloud mode refuses new trials.
NEXT_PUBLIC_TURNSTILE_SITE_KEYnoneTurnstile site key. A build argument of the dashboard, not read at runtime.
TRIAL_PROMPTS3Free Design Studio prompts per trial.
TRIAL_COST_CEILING_USD3Most model spend one trial may use.
TRIAL_DESIGNS2Designs per trial.
TRIAL_UPLOAD_BYTES26214400 (25 MB)Total upload size per trial.
TRIAL_IMPORTS2Scene imports per trial, ever (failed ones count).
TRIAL_IMPORT_MAX_BYTES26214400 (25 MB)Largest scene zip a trial may import.
TRIAL_ROOM_SCANS5Room scans a trial may hold at once.
TRIAL_PER_IP_DAY3New trials per IP address per day.
TRIAL_PER_DEVICE_DAY3New trials per device per day.
TRIAL_DAILY_BUDGET_USD50Daily model spend across all trials.
TRIAL_IDLE_DAYS14Days unused before a trial is removed.

The Design Studio runs only in cloud mode, so on a self-hosted install trials cover the scene tools.

Design Studio

A self-hosted server can run the Design Studio with its workers in Docker, free and with your own AI keys: see Design Studio for its settings. These settings shape its “Improve my prompt” button, which rewrites a draft before it is sent. The button needs ANTHROPIC_API_KEY on the server; without it the button is hidden.

VariableDefaultWhat it does
STUDIO_PROMPT_HELP_MODELclaude-haiku-5-5The Claude model that rewrites drafts.
STUDIO_PROMPT_HELP_PER_DAY30Rewrites each account (trials too) may ask for per UTC day. They don’t use prompts. 0 turns the button off. A value that isn’t a whole number stops the server from starting.

Assistant

The assistant is a chat panel on the dashboard. It needs ANTHROPIC_API_KEY on the server. Self-hosted installs (billing off) have no monthly budget cap.

VariableDefaultWhat it does
ASSISTANT_ENABLEDtruefalse turns the assistant off. Any other value than true or false stops the server from starting.
ASSISTANT_AUDIENCEadminsWho gets it: admins or paid (every paid account). Any other value stops the server from starting.
ASSISTANT_MODELclaude-sonnet-5-5The Claude model that answers.
ASSISTANT_DISABLED_TOOLSnoneComma-separated tool names to switch off, for example create_showing,add_to_library.
ASSISTANT_TOOL_CALLS_PER_MESSAGE12Most tool calls the assistant may make for one message.
ASSISTANT_MESSAGES_PER_MINUTE10Messages each account may send per minute.
ASSISTANT_ADMIN_BUDGET_USD20Monthly model-cost budget for an admin account, in US dollars. Applies only when billing is on.

Streaming

These connect the server to the streaming media server.

VariableDefaultWhat it does
ENABLE_STREAMINGfalse (on in cloud mode)true lets users create stream keys.
RTMP_INGEST_URLrtmp://localhost:1935/liveRTMP address shown to streamers (the OBS “Server”).
HLS_BASE_URLhttp://localhost:8000/streamsPublic base of HLS playback URLs.
STREAMING_WEBHOOK_KEYnoneShared secret with the media server (VIRVI_WEBHOOK_KEY there). Unset, single mode accepts unauthenticated calls to /api/streaming/authorize, /api/streaming/live-keys and /api/streaming/webhook; scalable and cloud mode refuse them (503). Set it whenever the server is reachable from the internet.

Decentraland

VariableDefaultWhat it does
VIRVI_DCL_DEPLOY_KEYnonePrivate key (32-byte hex) of a wallet used only to deploy Worlds an owner has granted it (“Let Virvi deploy for me”). A malformed key stops the server at boot (the error names the variable, never the value).
VIRVI_DCL_PARCEL_DEPLOY_KEYnoneA separate wallet’s private key for Genesis City parcels. Unset hides the “Make Virvi an operator” option; browser signing still works. A malformed key stops the server at boot.
DCL_REDEPLOY_SWEEP_MS30000How often pending redeploys are checked (0 disables).
DCL_MAP_SWEEP_MS60000How often to check whether Decentraland built a map snapshot for a new deploy (0 disables).
SHOW_WEARABLE_SWEEP_MS600000How often an assistant show waiting on a published wearable looks for it on the Decentraland Marketplace (0 disables).
DCL_MARKETPLACE_API_URLhttps://marketplace-api.decentraland.orgMarketplace API that show wearables are looked up in.
DCL_CATALYST_URLhttps://peer.decentraland.orgCatalyst for Genesis City deploys and parcel permissions.
DCL_LAND_SUBGRAPH_URLhttps://subgraph.decentraland.org/land-managerLAND subgraph, used to find a parcel’s estate.
DCL_WORLDS_URLhttps://worlds-content-server.decentraland.orgWorlds content server.
DCL_MAP_MANIFEST_URLhttps://abgen-cdn.decentraland.org/LOD/lods-unity/manifestsWhere map snapshots are looked up.

Wearable giveaways

Automatic wearable giveaways (see Drops) mint from a wallet the server makes for each giveaway. They are off unless GIVEAWAY_WALLET_SECRET is set; the server starts normally without it.

VariableDefaultWhat it does
GIVEAWAY_WALLET_SECRETnone64 hex characters (openssl rand -hex 32). Seals each giveaway wallet’s private key. Unset, automatic giveaways are off. A malformed value stops the server from starting. Back it up: if you lose it, the POL in every giveaway wallet is lost.
GIVEAWAY_GAS_KEYnonePrivate key (32-byte hex) of the shared gas-tank wallet that tops up giveaways of paid accounts. Unset, every host funds their own giveaway wallet. A malformed key stops the server from starting.
GIVEAWAY_GAS_TANK_MIN_POL5The gas tank’s floor on Polygon, in POL. Below it, top-ups stop and admins are warned.
GIVEAWAY_JOB_EVERY_MS15000How often the minting job runs, in milliseconds.

Hosted Hyperfy worlds

Optional. “Create a hosted world” appears only when HYPERFY_INFRA_PROVIDER=fly and all of these are set: FLY_API_TOKEN, FLY_WORLDS_ORG, HYPERFY_IMAGE, HYPERFY_WORLDS_DB_URL_TEMPLATE (a postgres:// URL containing {user} and {password}), HYPERFY_ASSETS_S3_URI, HYPERFY_ASSETS_BASE_URL, HYPERFY_ROUTER_DOMAIN and HYPERFY_SECRET_KEY (32 bytes of hex). HYPERFY_WORLDS_DB_MODE is fly-job (default with Fly; uses the HYPERFY_DB_JOB_APP app, default vlm-worlds-db-jobs) or direct (needs HYPERFY_WORLDS_DATABASE_URL).

Connecting a Hyperfy world you run yourself needs none of these.

Billing

Billing is for cloud mode.

VariableDefaultWhat it does
STRIPE_SECRET_KEYnoneTurns billing and plan limits on, in any mode. Leave it unset on a self-hosted install, or features become gated by plan.
STRIPE_WEBHOOK_SECRETnoneVerifies Stripe webhooks at /api/billing/webhook.
STRIPE_PRICE_CREATOR, STRIPE_PRICE_PRO, STRIPE_PRICE_STUDIOnoneStripe price IDs for each plan. A plan whose price isn’t set shows “Price coming soon” on Settings and can’t be bought.

Monitoring and background jobs

VariableDefaultWhat it does
ENABLE_METRICSfalse in single mode; always on in scalable and cloudtrue collects Prometheus metrics. They’re served at /metrics only with METRICS_TOKEN set.
METRICS_TOKENnoneThe token a scraper sends to read /metrics, as Authorization: Bearer <token>. Unset, /metrics isn’t served.
ANALYTICS_JOBSonfalse stops analytics background jobs (session close, rollups, retention).
ERROR_REPORTINGonfalse stops recording error events in the database.
LIFECYCLE_SWEEP_MS5000How often venue bookings are advanced (0 disables).
GEOIP_COUNTRY_DB_PATHnonePath to an .mmdb country database for analytics. Without it, countries come only from a CDN header such as cf-ipcountry.
FFPROBE_PATHffprobeffprobe binary, used to read video lengths. The Docker image includes FFmpeg.

Build-time variables

The dashboard is a static export. These are baked in when the image is built (docker build --build-arg ...), not read at runtime.

Build argumentDefaultWhat it does
NEXT_PUBLIC_API_URLPUBLIC_URL with Docker Compose, else http://localhost:3010Where the dashboard sends API calls. Built into the dashboard: rebuild after changing it.
NEXT_PUBLIC_WSS_URLws://localhost:3010Where the dashboard opens WebSockets: your PUBLIC_URL with wss:// (or ws://).
NEXT_PUBLIC_DOCS_URLthe server’s own /docs/Docs link on the landing page.
NEXT_PUBLIC_DISCORD_URLnoneDiscord link on the landing page; hidden when unset.
NEXT_PUBLIC_TURNSTILE_SITE_KEYnoneTurnstile site key for trials.

The server’s /llms.txt, /docs/llms.txt, /docs/llms-full.txt and /docs/<page>.md files link to its own address (WEB_APP_URL, which defaults to PUBLIC_URL), so an agent reading your install’s docs stays on your install. The HTML pages keep their virvi.io canonical links.