Run JupyterLab in the cloud on Railway for data science
Short answer: deploy Tracklayer’s JupyterLab template on Railway to get JupyterLab 4.6.4 in your browser with pandas, NumPy, SciPy, scikit-learn, matplotlib, seaborn, statsmodels and Dask already installed. It is one password-protected service with your home directory on a persistent volume, so there is nothing to set up on your laptop and your work is still there after a redeploy.
Deploy JupyterLab on RailwayWhen a cloud notebook makes sense
A hosted notebook server helps when your laptop is the limit, or when you do not want to manage Python environments locally:
- exploratory data analysis and charts with pandas, matplotlib and seaborn,
- training and evaluating scikit-learn and statsmodels models on data too big for a laptop session,
- querying databases on your Railway private network from notebooks (SQLAlchemy is included),
- a remote Jupyter kernel for VS Code or PyCharm,
- an always-on scratchpad for scripts and teaching.
It is a single-user server. If several people need notebooks, each person gets their own instance.
What the template deploys
One service, no external dependencies and no API keys:
| Part | Detail |
|---|---|
| Image | Jupyter Docker Stacks scipy-notebook, weekly build 2026-10-05 |
| Versions | JupyterLab 4.6.4, Python 3.13 |
| Storage | Railway volume at /home/jovyan |
| Access | Generated JUPYTER_PASSWORD and JUPYTER_TOKEN |
The password is hashed at start, so it does not appear inside notebooks or terminals. If you shut Jupyter down from the menu, it restarts itself inside the container.
Deploy JupyterLab, step by step
These steps use Tracklayer’s JupyterLab 4 template.
- Deploy the template. The service listens on port 8888 and Railway checks
/apito see that it is healthy. - Find your password. Open the service, then Variables, and copy
JUPYTER_PASSWORD. - Sign in. Open the service URL and enter the password.
- Work under your home directory. Keep notebooks under
/home/jovyan, for example~/work. Everything there persists. - Install packages. Run
%pip install packagein a notebook, orpip install packagein a terminal. WithPIP_USER=1, packages go to~/.localon the volume. - Optional: connect an IDE. Use
https://your-domain/?token=followed byJUPYTER_TOKENas the existing Jupyter server URL.
For a separate environment, run mamba create -n name python=3.12 ipykernel, then ~/.conda/envs/name/bin/python -m ipykernel install --user --name name. Both the environment and the kernel persist.
Persistence
The volume holds notebooks, settings, pip installs and conda environments. Setting GRANT_SUDO=yes enables sudo apt-get, but system packages are not on the volume and reset on redeploy. Plan for that if you need system libraries.
Memory and cost
Memory is the main cost driver on Railway’s usage billing. The template documents these figures:
- Measured: about 110 MB for the Jupyter server, and about 160 MB with one idle kernel.
- Estimated: about $2 a month idle, and about $28 a month for typical use. The estimate assumes 2 GB of RAM, 0.3 vCPU and a 10 GB volume at the Railway prices listed in the template’s TEMPLATE.md.
- Plan guidance from the template: the Trial plan (1 GB RAM per service) works for light notebooks. Hobby is recommended for real data work, and its 5 GB volume cap limits datasets and extra conda environments. Pro allows larger volumes.
Each kernel holds its data in memory, so working on a few GB of data can mean peaks of 2 to 6 GB. To cut the cost of forgotten kernels, set JUPYTER_KERNEL_CULL_IDLE_TIMEOUT. Railway grows RAM and CPU vertically up to your plan limit.
Limitations and licence
- Single user: keep one replica.
- System packages: reset on redeploy.
- Python upgrades: packages in
~/.localare tied to the Python minor version, so reinstall them after a Python upgrade. - Licence: BSD-3-Clause for Jupyter components, as listed in the template’s NOTICE. The template is a community template, not affiliated with Project Jupyter.
Upgrades
The base image is set by ARG BASE_IMAGE in services/jupyterlab/Dockerfile in the template. Docker Stacks publishes a new date tag every week. Change the tag and redeploy. Your volume, and the packages on it, carry over.
Other options
If you want files, calendars and sharing rather than notebooks, see the Nextcloud template. If you want a team wiki with whiteboards, see the AFFiNE template. More walkthroughs are listed under guides.
FAQ
How do I log in to JupyterLab after deploying?
Open the service URL and enter JUPYTER_PASSWORD from the service's Variables tab. To connect an IDE such as VS Code or PyCharm, use the server URL with ?token= followed by JUPYTER_TOKEN. Scripts can send the header Authorization: token followed by the same token.
Do my notebooks and packages survive a redeploy?
Yes. The whole /home/jovyan directory is on a Railway volume, including notebooks, settings, pip installs in ~/.local and conda environments. System packages installed with sudo apt-get (which needs GRANT_SUDO=yes) are reset on redeploy.
Can a team share one instance?
No. It is a single-user server, so keep one replica. For a team, deploy one instance per person.
How do I keep memory use down?
Each open kernel keeps its data in RAM. Set JUPYTER_KERNEL_CULL_IDLE_TIMEOUT, in seconds, to shut down idle kernels automatically.
What licence does the software use?
The template's NOTICE lists the Jupyter Docker Stacks scipy-notebook image, JupyterLab and Jupyter Server as BSD-3-Clause, run unmodified. The Python packages in the image carry various open-source licences. This is a community template, not affiliated with Project Jupyter.