Railway

Deploy JupyterLab | (Just Updated) Notebooks and pip Installs Survive Redeploys

Hosted JupyterLab whose notebooks and pip installs survive every redeploy

Deploy JupyterLab | (Just Updated) Notebooks and pip Installs Survive Redeploys

/home/jovyan

Deploy and Host JupyterLab on Railway

JupyterLab is the browser-based notebook and data-science workspace from Project Jupyter: notebooks, a terminal, a file browser and an editor over a full SciPy stack (NumPy, pandas, scikit-learn, matplotlib, SciPy, and the rest of the scipy-notebook image).

This template runs it as one service on one volume, with the two things a hosted notebook actually has to do: your notebooks are still there after a redeploy, and so are the packages you pip installed.

About Hosting JupyterLab

JupyterLab keeps everything in the home directory of the user it runs as — /home/jovyan in the official Jupyter Docker Stacks image. That is the file-browser root, that is where a new notebook is saved, and that is where pip install --user puts packages.

On Railway that matters more than it does locally, because the container filesystem is discarded on every redeploy. A volume mounted anywhere narrower than the home directory persists only the part of your work that happens to be underneath it, and packages installed from a notebook go to the image's own site-packages, which is not on any volume at all.

This template mounts the volume at /home/jovyan itself and restores the image's home skeleton for anything the volume does not already carry, so both the default save location and the user site-packages directory are on persistent disk. It also honours Railway's injected PORT, repairs the root-owned volume mount before the server drops privileges, and refuses to start without a password — JupyterLab runs arbitrary code, so an unauthenticated public URL is not an option.

Why Deploy JupyterLab on Railway?

Railway gives the notebook server a public HTTPS URL, a persistent volume and a fixed monthly resource footprint with no VM to maintain. Compared with running a notebook on your laptop, the kernel keeps running when you close the lid, long jobs survive a lost network, and the URL is shareable. Compared with a managed notebook service, you keep the full SciPy image, root over your own environment, and no per-seat pricing.

The password is generated for you at deploy time, and re-applied on every boot — so redeploying is also the way to reset it if it is lost.

Common Use Cases

  • Exploratory data analysis and modelling on a machine that stays awake between sessions.
  • A shared scratch environment for a small team, reachable from any browser.
  • Long-running data pulls, scraping or training loops that must survive a closed laptop.
  • Teaching or demo notebooks served from a stable URL.

Dependencies for JupyterLab

Deployment Dependencies

  • A Railway volume mounted at /home/jovyan (created by this template).
  • JUPYTER_PASSWORD — generated automatically; the container will not start with an empty value.

Implementation Details

pip install from inside a notebook goes to /home/jovyan/.local/lib/python3.13/site-packages (PIP_USER=1), which is on the volume, and ~/.local/bin is on PATH so installed console scripts work. The server listens on Railway's injected PORT, and the healthcheck is /login.


Template Content

More templates in this category

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

codestorm
44
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
51