Deploy Photon OS Terminal
Minimal Photon OS 5.0 browser terminal with persistent storage.
photon-railway
Just deployed
/root
Deploy and Host Photon OS Terminal on Railway
A Photon OS shell that runs in your browser. It runs VMware Photon OS 5.0 with ttyd serving a real Bash shell over HTTPS, protected by a username and password that Railway generates for you. Open the URL, log in, and you have a root prompt. No SSH keys, no VPN, no local install.
About Hosting Photon OS Terminal
Hosting a browser terminal means three things: keeping a long-lived container alive, putting it behind authentication on a public URL, and making its filesystem survive restarts. This template does all three. The image is built from a Dockerfile, ttyd starts with HTTP basic auth, and a volume is mounted at /root so your home directory, your checkouts and anything you install stay put across redeploys and restarts.
Photon OS is VMware's minimal container host Linux, tuned for small footprint and fast boot. It uses tdnf, a lighter reimplementation of dnf, and keeps the package set deliberately narrow. If your organisation runs Photon on vSphere or Tanzu, this is the matching userland.
Railway terminates TLS and assigns the public domain automatically, so the terminal is reachable the moment the first deploy goes green. There is nothing to configure after you click Deploy.
Common Use Cases
- Test a script or an RPM against Photon's
tdnfand package layout. - Match the userland of a Photon host running on vSphere or Tanzu.
- Get a very small, fast-booting Linux box for a one-off job.
- Keep a long-running job alive in the cloud after you close your laptop.
- Reach your other Railway services over the project's private network from a real shell.
Dependencies for Photon OS Terminal Hosting
- A Railway account and a single service. No database, no external API, no extra setup.
- A volume mounted at
/root, which this template creates for you. - A modern browser. Everything runs server-side; the browser only draws the terminal.
Implementation Details
The terminal starts as:
ttyd -p "$PORT" -c "$USERNAME:$PASSWORD" /bin/bash
Both variables are quoted, so a password containing spaces or shell metacharacters works exactly as typed. An earlier version of this template left them unquoted, which broke login for any generated password containing a special character; that is fixed.
/root is a mounted volume, so anything written there at build time would be hidden once the volume mounts. The shell config is therefore seeded on first boot instead, and only once, rather than appended on every restart.
What's Installed
Python 3, Git, GCC, make, plus curl, wget, vim, tar, zip/unzip, sudo, and the usual network tools.
Anything else is one tdnf install away, and it persists, because /root is on the volume — though packages installed outside /root are lost on redeploy. Install those into a script under /root if you want them to survive.
Security Notes
The terminal sits behind HTTP basic auth over HTTPS and runs as root inside its own container, isolated from anything else in your project unless you connect it. Anyone with the URL and the credentials gets a root shell, so change PASSWORD to something you control before sharing the link, and treat it like an SSH key.
Environment Variables
USERNAME— terminal login username. Defaults toroot.PASSWORD— terminal login password. Generated for you at deploy time.PORT— port ttyd listens on. Railway routes the public domain to it.
Configuration
| Variable | Description |
|---|---|
| USERNAME | Login name for the web terminal. Defaults to root. |
| PASSWORD | Login password. Generated for you at deploy time — read it from the service's Variables tab, or set your own before deploying. |
| PORT | Port ttyd listens on. Defaults to 7681; Railway maps it to the public URL for you. |
| INSTALL_CLAUDE_CODE | Set to true to install Claude Code on first boot (default: false). |
Opening the service URL prompts for USERNAME and PASSWORD over HTTP Basic
auth. The terminal is a root shell on the public internet, so treat that password
as the only thing standing between a stranger and your container — change it from
the generated value only to something stronger, never something weaker.
A volume is mounted at /root, so files you leave in the home directory survive
restarts and redeploys. Packages installed with the system package manager live
outside /root and do not survive a redeploy — reinstall them, or bake them
into the image if you need them permanently.
Claude Code in the terminal (optional)
Set INSTALL_CLAUDE_CODE to true and Claude Code is installed on first boot, into /root/.local/bin on the volume — so it survives restarts and keeps itself updated. It is off by default, which keeps the image small for everyone who does not want it.
The install happens at boot rather than at build time on purpose: /root is the mounted volume, so anything written there while building is hidden the moment the volume mounts.
You still need your own access — a Claude Pro, Max or Team account, or an ANTHROPIC_API_KEY with credit on it. Nothing in the install can stop the terminal from starting; if it fails, you get a message and a working shell.
Why Deploy Photon OS Terminal on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Photon OS Terminal on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
photon-railway
Amritasha/photon-railway