Skip to content

Self-Hosting Overview

Virvi is open source (GPL-3.0; the @virvixr/dcl package that goes into your scenes is Apache-2.0). A self-hosted install has every feature unlocked: no billing, no plan limits.

What you run

PartNeededNotes
Virvi serverYesOne Docker image from the root Dockerfile: the API (Fastify), real-time rooms (Colyseus), the dashboard and these docs, all on one port (3010).
PostgreSQLYesThe Compose files use Postgres 16. Any Postgres your server can reach works.
RedisScalable mode onlyShares real-time rooms between servers.
File storageYesLocal disk (default) or an S3-compatible bucket (AWS S3, Cloudflare R2, MinIO).
Streaming media serverOnly for live streamsA separate app, apps/streaming (RTMP in, HLS out). See Live streaming.

Pick a mode

Set VIRVI_MODE.

single (default)scalable
ServersOneSeveral, behind a load balancer
Real-time roomsIn memoryRedis (REDIS_URL required)
StorageLocal disk, or S3/R2S3/R2 when servers run on different machines
Scene import filesLocal disk (PRIVATE_STORAGE_PATH)A bucket (SCENE_IMPORT_S3_URI)
Rooms per server (MAX_ROOMS)50500
/metricsOff unless ENABLE_METRICS=trueAlways on
First accountInstance adminInstance admin

The third mode, cloud, runs the hosted virvi.io service (billing, the Design Studio). Don’t use it for a self-hosted install.

Start

Follow Docker Compose. The short version:

Terminal window
git clone https://github.com/virvi-xr/virvi.git && cd virvi
printf 'JWT_SECRET=%s\nPOSTGRES_PASSWORD=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 16)" > .env
docker compose -f docker-compose.single.yml up -d --build
curl -s http://localhost:3010/api/health

Then open http://localhost:3010 and sign up. The first account becomes the instance admin.

For any address other than localhost:3010, also follow Your own domain: the dashboard’s API address is set when the image is built.

What the server does when it starts

The image runs apps/server/entrypoint.sh:

  1. If DATABASE_URL is set: runs scripts/pre-push-upgrade.mjs, then drizzle-kit push to create or update every table from apps/server/src/db/schema.ts. If the push fails, it runs a built-in SQL fallback that adds the newest tables and columns, and carries on.
  2. Starts node apps/server/dist/index.js, which checks the database connection, adds the btree_gist extension and the booking overlap constraint, and starts listening.

There are no migration files to run by hand. Updating is: pull, rebuild, restart. See Updating and Troubleshooting.

What it serves

Everything is on one port.

PathWhat
/The dashboard (a static export in /app/dashboard, DASHBOARD_DIR). Unknown paths outside /api/ get the dashboard’s index.html.
/api/...The REST API. See REST API Reference.
/api/healthHealth check: 200 when Postgres answers, 503 otherwise.
/api/instancePublic install info: mode, version and branding.
/api/docsSwagger UI. The OpenAPI document is at /api/docs/json (and /api/docs/yaml).
/hook/...Platform hooks for HTTP-only platforms.
/uploads/...Uploaded files, with local storage.
/docs/...These docs, built into the image (DOCS_DIR). Every page also has a .md version, plus /docs/llms.txt, /docs/llms-full.txt and /llms.txt.
/metricsPrometheus metrics, when enabled and METRICS_TOKEN is set. Needs Authorization: Bearer <token>.
WebSocket on /Real-time rooms (Colyseus): virvi_scene, virvi_command_center, virvi_studio.

Without a dashboard folder the server runs API-only. Without a docs folder it has no /docs routes. The Docker image has both.

Where to run it

HostFiles in the repoNotes
Any Linux machine with Dockerdocker-compose.single.yml, docker-compose.scalable.ymlThe path these docs follow.
RailwayDockerfile, .railway/railway.tsStart command apps/server/entrypoint.sh, health check /api/health. Add a Postgres database, set DATABASE_URL, JWT_SECRET, PUBLIC_URL, and TRUST_PROXY_HOPS=2. Set NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WSS_URL as variables so the build sees them.
Fly.iofly.tomlSingle mode on port 3010 with a /api/health check. Uploads go on a volume: create it once with fly volumes create virvi_data --region iad --size 10 before the first deploy. Set DATABASE_URL and JWT_SECRET as secrets.
Renderrender.yamlGenerates JWT_SECRET; you set DATABASE_URL and PUBLIC_URL. It stores uploads on a 10 GB persistent disk (Render doesn’t do zero-downtime deploys for a service with a disk); for S3/R2 instead, set STORAGE_PROVIDER=s3 and the S3 variables.

On any host, set TRUST_PROXY_HOPS to the number of proxies in front of the server.

Things to set before going public

  • A strong JWT_SECRET and POSTGRES_PASSWORD.
  • PUBLIC_URL, and the dashboard build arguments for your address.
  • TRUST_PROXY_HOPS for your proxy setup (0 with no proxy).
  • STREAMING_WEBHOOK_KEY if you turn streaming on.
  • METRICS_TOKEN if you scrape /metrics; without it the route isn’t served.
  • Keep Postgres (5432) and Redis (6379) off public interfaces. The Compose files publish them on 127.0.0.1 only.
  • SMTP_* and EMAIL_FROM so password resets work, and AR_REPORTS_EMAIL so space reports are emailed to you.
  • Sign up first, so you are the instance admin.

Branding

A self-hosted install can show its own logo and name instead of Virvi’s. Only instance admins see this section.

Open Settings → Branding to set:

  • Logo: a PNG, WebP or SVG up to 512 KB, shown at up to 160 × 40 px. It replaces the Virvi wordmark in the sidebar and on the sign-in page.
  • Name (optional, up to 32 characters). It’s the logo’s alt text and replaces “Virvi” in the browser tab title.
  • Favicon (optional): a square PNG, at least 64 × 64 px.

Reset to Virvi removes all three. The install label stays visible under a custom logo, as “Self-hosted · Powered by Virvi” (or “Self-hosted · Scalable · Powered by Virvi”).

Images are stored with the install’s normal media storage, checked by their content and saved as PNG. SVGs are converted to PNG on upload, so scripts in them never run; an SVG that loads outside files is refused. In cloud mode there is no branding.

The API: PUT /api/instance/branding and DELETE /api/instance/branding (instance admins only, not in cloud mode).