
Deploy code-server Python
Browser VS Code set up for Python and Jupyter notebooks
code-server
Just deployed
/home/coder
Deploy and Host self hosted code-server Python (Browser VS Code for Python and Jupyter Notebooks) on Railway
This template runs code-server, the open-source VS Code in the browser, with a persistent home directory on Railway. Only /home/coder survives redeploys, so install Python tooling there with uv, not apt.
About Hosting code-server Python open-source software on Railway (self hosted code-server for Python development template)
This template runs the official codercom/code-server 4.141.0 image, which bundles VS Code 1.141.0 and serves the full editor and terminal to your browser. Install Python tooling such as uv under your home directory instead.
Railway handles provisioning, the HTTPS domain, health checks and restarts. The container drops from root to the coder user after fixing volume ownership. You keep the password and the data.
Why Deploy code-server Python, the GitHub Codespaces alternative on Railway (Railway Free Trial)
If you want VS Code in the browser without paying per core-hour, self hosting code-server gives you a flat monthly cost and a machine you control.
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 code-server Python 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.
Railway vs Other Hosting Providers and VPS for code-server Python self hosting
A VPS gives you full control but leaves the Python toolchain, HTTPS and restarts to you.
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | A one-click template with a persistent /home/coder volume and HTTPS on a public domain. | Full root access and a cheap droplet, but you set up code-server and the reverse proxy yourself. |
| AWS | Flat service billing with no VPC or security groups to configure before first login. | Deep control over instances and storage, but EC2 and load balancers add setup time. |
| Hetzner | Managed deploys and automatic restarts without writing a systemd unit. | Low cost per GB of RAM, but you own the OS, firewall and every package. |
Common Use Cases for hosted code-server Python
- Python scripting from any device: Keep one browser tab open on your code-server and run scripts from a laptop, Chromebook or iPad. Your venv and projects live under /home/coder, so the environment is the same each time you log in.
- Jupyter notebooks in the browser: Install the Jupyter extension from Open VSX, create a .ipynb file and run cells against a .venv that has ipykernel installed. Long notebook runs keep going even when your laptop sleeps.
- FastAPI or Flask development with the port proxy: Run uvicorn on port 8000 in the terminal, then open https://your-domain/proxy/8000/ behind the same login to test the API while you edit.
- Data cleaning jobs: Run pandas scripts against files in /home/coder/workspace and watch memory, since the editor, language server and your job share the container's RAM.
- Teaching or workshops: Pre-install packages in an ENTRYPOINTD script, then give students the password so everyone starts with the same Python setup.
Dependencies for code-server Python Docker hosted on Railway
This section covers what the code-server Python template needs to run on Railway and how the image is wired together.
Deployment Dependencies for Managed code-server Python Service (Cloud IDE)
You need a Railway account and the template deployed as a single service. The PASSWORD variable is generated per deploy, and you read it from the Variables tab to log in. Nothing else is required to start.
Implementation Details for code-server Python (Using code-server official docker image)
The container uses codercom/code-server 4.141.0, which bundles VS Code 1.141.0, pinned by tag and digest.
How does code-server Python compare against other ways to code Python in the browser
code-server vs GitHub Codespaces (Hosted Dev Environments Alternative)
- Where it wins for code-server: One persistent box with your own Python toolchain, billed as a flat Railway cost.
- Persistence: Only /home/coder survives a redeploy, so uv installs and virtualenvs under home stay put.
- Where Codespaces wins: GitHub runs the machine and drives setup from devcontainer.json.
code-server vs JupyterLab (Notebook-First IDE Alternative)
- Where it wins for code-server: You get full VS Code with git, a debugger and extensions, not just notebooks.
- Notebooks: The Jupyter extension runs notebooks in the editor, but you still need ipykernel in your .venv.
- Where JupyterLab wins: It is lighter and built for notebooks first.
code-server vs Google Colab (Hosted Notebooks Alternative)
- Where it wins for code-server: Files and packages persist on a volume instead of vanishing when a Colab runtime recycles.
- Hardware: Colab offers GPU and TPU tiers a Railway container will not match.
- Where Colab wins: It starts in seconds from a browser with no setup at all.
code-server vs Replit (Browser IDE Alternative)
- Where it wins for code-server: You run standard VS Code with the stock Python extensions.
- Control: You own the container and its volume, and can swap the image tag without losing your home directory.
- Where Replit wins: It bundles hosting and onboarding, so there is far less to configure yourself.
How to use code-server Python (the OSS browser IDE)?
- Open your public domain and paste the PASSWORD value from the Variables tab. You land in /home/coder/workspace.
- Open the terminal and install uv into your home directory with its install script. Only /home/coder survives a redeploy.
- In your project folder, run uv python install and uv venv, then uv pip install your packages.
- Install the Python and Jupyter extensions from Open VSX. Pylance is unavailable, so basedpyright is a fair substitute.
- Run Python: Select Interpreter and pick .venv/bin/python.
- Create a notebook, select the .venv kernel, and run a cell.
- Start uvicorn on port 8000 and open https://your-domain/proxy/8000/ behind the same login.
curl -LsSf https://astral.sh/uv/install.sh | sh
uv python install 3.13
uv venv
uv pip install ipykernel fastapi uvicorn
uvicorn main:app --port 8000
How to self host code-server Python on other VPS Services (code-server self hosting guide)
Clone the Repository
Pull the official image so you have nothing to build:
docker pull codercom/code-server:4.141.0
Create a host folder for the home directory, since that is the only path that needs to survive restarts.
Install Dependencies
Docker is the only hard requirement. Make the host folder writable by UID 1000, the coder user inside the container.
Configure Environment Variables
Create ~/.config/code-server/config.yaml on the host:
bind-addr: 0.0.0.0:8080
auth: password
password: your-password-here
Put HTTPS in front with Caddy or nginx, since code-server needs WebSockets and the password should not travel in plain text.
Start the code-server Python Application
Run the container with the home directory mounted:
docker run -d --name code-server -p 8080:8080 -v ~/code-server-home:/home/coder codercom/code-server:4.141.0
Install uv under /home/coder so the toolchain survives a restart. Anything installed with apt lives in the container filesystem and is lost on recreate.
Railway handles HTTPS, the public domain, the volume and the restart policy for you.
Official Pricing of code-server Python (code-server pricing)
code-server is free and open source under the MIT license, so there is no code-server subscription or license fee to pay.
code-server Python cloud vs self hosted comparison (Pricing, features, costs, and more)
Self hosting code-server Python splits into two costs: the platform you run it on and the time you spend keeping the Python toolchain healthy.
Monthly cost of self hosting code-server Python on Railway
On Railway you pay for one always-on code-server service, usually about $5-15 per month at light to moderate use, depending on how much RAM your data work needs. Railway's $5 trial lets you test the setup first.
System Requirements for Hosting code-server Python on a VPS
A VPS needs enough RAM for VS Code, the Python language server and any notebook kernel, with 1-2 GB comfortable for everyday scripting and more for pandas. The same box also runs your dev servers and builds.
Frequently Asked Questions (FAQs)
Why did python3 disappear after I redeployed?
Packages installed with apt live in the container filesystem, and only /home/coder survives a redeploy.
Why is Pylance missing from the extensions list?
Pylance is licensed only for Microsoft products, and code-server pulls extensions from Open VSX, which does not offer it.
Where should I keep my virtual environments?
Create them inside your project under /home/coder/workspace, for example with uv venv, so they sit on the persistent volume. Then select the .venv/bin/python interpreter in the editor.
Can I run Jupyter notebooks in the browser?
Yes, install the Jupyter extension from Open VSX and add ipykernel to your environment with uv pip install ipykernel. Then open a .ipynb file and pick that environment as the kernel.
How do I open the dev server I started?
Start the server on a port such as 8000 and open https://your-domain/proxy/8000/ behind the same login. Apps that cannot handle a path prefix can use /absproxy/8000/ instead.
How much RAM do I need for pandas?
A light pandas session with a few hundred megabytes of data fits in 1-2 GB alongside VS Code, but larger datasets need more.
Template Content
code-server
codercom/code-server:4.141.0