Deploy A Dark Room

Minimalist text adventure that grows from one button in a dark room

Deploy A Dark Room

Just deployed

Deploy and Host A Dark Room on Railway

A Dark Room is a minimalist text adventure by Michael Townsend that opens with a single button in an unlit room and unfolds into resource gathering, village building, trading and a long journey outward. It became a cult hit after its 2013 browser release and now ships on Steam and Switch, but the original browser version stays open source under MPL-2.0 at doublespeakgames/adarkroom. Self-host A Dark Room when you want a permanent, ad-free copy for a community, a classroom or an intranet.

Deploy A Dark Room on Railway and you get one public web service named adarkroom, built from the gridalpha/adarkroom-railway source repository. The build fetches the upstream game, removes the analytics tag and CDN script that ship in the public copy, points the in-game share buttons at your own domain, pre-compresses the text assets and serves everything from nginx behind Railway's TLS edge. There is no database, no queue and no volume: the game keeps every save in the player's own browser storage.

Single adarkroom web service in the Railway project

Getting Started with A Dark Room on Railway

Open the generated *.up.railway.app URL and the game is immediately playable — no installer, no account, no login screen. You will see a nearly empty page with one button reading light fire or stoke fire; press it, and the room warms. Keep the fire going and within a minute a ragged stranger stumbles in, becomes your builder, and a second tab labelled A Silent Forest appears. Switch to it and press gather wood until you have thirty or forty logs, then return to the room, where a build: menu now offers a trap, a cart and a hut. Build two traps, go back to the forest and press check traps; fur and scales appearing in your stores is the clearest proof the deployment works.

Progress is written to browser local storage every few actions, so reloading resumes where you stopped, while a private window starts fresh. The footer's language. link switches between the twenty-five bundled translations, and hyper. doubles every timer if you would rather not wait out the early cooldowns.

The firelit room with the build menu and wood store The silent forest showing traps, fur and scales The same saved game rendered in French

About Hosting A Dark Room

A Dark Room belongs to the incremental genre that Candy Box started and Universal Paperclips popularised: almost nothing is on screen at first, and the interface itself is what grows. It is worth hosting rather than linking because it is a finished game distributed as plain HTML, JavaScript and CSS, with no backend and no service that can be discontinued out from under you.

Key features:

  • A several-hour game spanning a room, a village, a wasteland map and a final journey
  • Twenty-five community translations, selectable at runtime with no rebuild
  • Eighty-six original music and effect tracks, loaded on demand as FLAC
  • Saves in browser storage, with export and import through the footer menu
  • Mobile and desktop layouts, including swipe navigation between locations
  • No accounts and no server-side state, so nothing to back up or migrate

Because the game is fully client-side, the Railway architecture is deliberately a single tier. The adarkroom service runs nginx with the built game as its document root and answers Railway's health check from a route that reads the game's own index.html off disk, so a deployment only passes if the game is really there to serve.

Why Deploy A Dark Room on Railway

Railway handles the fiddly parts of hosting a static game:

  • One service, no database and no volume, so the running cost is minimal
  • TLS, a public domain and HTTP/2 provisioned automatically
  • Rebuilds on every push, with rollback to any earlier build
  • Worker processes sized from the container's real CPU quota, not the host's
  • Custom domains attach without touching the image
  • Replicas are safe, since no request carries server-side state

Common Use Cases

  • A permanent, ad-free copy for a gaming community, Discord server or LAN party
  • Teaching incremental game design or vanilla JavaScript from a live, modifiable deployment
  • Hosting a translated or modified fork by pointing the build at your own upstream fork
  • An internal entertainment page on a company intranet

Dependencies for A Dark Room

  • nginxinc/nginx-unprivileged:1-alpine — serves the built game as a non-root user
  • alpine:3 — the build stage that fetches the game, patches it and pre-compresses assets
  • doublespeakgames/adarkroom — the game itself, fetched at build time

Environment Variables Reference

VariableDefaultPurpose
PORT8080Port nginx listens on; Railway sets this and the config substitutes it at boot
ADR_REFmainUpstream git ref to build. Set it to a tag such as 1.4 or a commit SHA to pin the game version
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE1Sizes nginx workers from the container's CPU quota rather than the host's core count
NGINX_ENVSUBST_FILTER^PORT$Restricts config substitution to PORT, leaving nginx's own variables intact

Every variable has a working default, so a deployment needs no input at all.

Deployment Dependencies

Hardware Requirements for Self-Hosting A Dark Room

ResourceMinimumRecommended
CPU0.1 vCPU0.5 vCPU
RAM128 MB256 MB
Storagenone (no volume)none (no volume)
Runtimenginx 1.31 on Alpinenginx 1.31 on Alpine

Memory use is dominated by nginx worker processes rather than by traffic, so one instance comfortably serves a large audience: every request is a static file and all game logic runs in the visitor's browser.

Self-Hosting A Dark Room

Upstream publishes no container image — the repository is loose static files plus a development-only Express server — so running it yourself means serving the directory or building an image. To run the development server locally with Node:

git clone https://github.com/doublespeakgames/adarkroom.git
cd adarkroom
npm install
npm start

That serves the working tree on port 8080, which is right for editing but not for production: it ships the upstream analytics tag and has no compression or caching. For a production copy, build the packaging repository this template uses:

git clone https://github.com/gridalpha/adarkroom-railway.git
cd adarkroom-railway
docker build -t adarkroom .
docker run --rm -p 8080:8080 -e PORT=8080 adarkroom

Pass --build-arg ADR_REF=1.4 to build a specific upstream tag instead of the current main.

Is A Dark Room Free to Self-Host?

The browser version is free and open source under the Mozilla Public License 2.0 — no licence fee, no seat count, no feature gating — and you may host, modify and translate it provided modified source files stay under the same licence. The paid iOS, Android and Steam releases are separate, expanded products from the same developer. On Railway you pay only for the container, which for a single static service with no database and no volume is among the cheapest things you can run.

FAQ

What is A Dark Room?

A minimalist text adventure and incremental game that begins with one button in a dark room and gradually reveals resource management, village building, combat and exploration.

What does this Railway template deploy?

One public web service called adarkroom, running nginx with the upstream game built in. No database, no queue, no volume and no configuration are required.

Why is there no database in this template?

The game has no server side. Saves live in the visitor's browser, so there is nothing for a database or volume to hold and every deployment is stateless.

How do I pin a specific version of the game?

Set ADR_REF to an upstream tag such as 1.4 or a commit SHA, then redeploy. It defaults to main, tracking the latest upstream state.

Does the self-hosted version send data to anyone?

No. The build removes the analytics tag and the third-party script the public copy loads, so a deployed instance serves only its own files.

How do I change the language?

Use the footer's language. link, or add a language code to the URL — ?lang=fr, ?lang=ja. Twenty-five translations are bundled and the choice is remembered.

Can my players transfer a save between devices?

Yes. The footer's save. menu exports the game as a text blob that imports into any other copy of A Dark Room, including the official one.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
47
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
50