Deploy Ubuntu Python uv

Persistent Ubuntu box for Python scripts and projects with uv

Deploy Ubuntu Python uv

Deploy and Host self hosted Ubuntu Python uv (Self-Hosted Python Workspace With uv) on Railway

This template gives you a persistent Ubuntu 26.04 box on Railway, reachable by browser or SSH, with uv ready to use.

About Hosting Ubuntu Python uv open-source software on Railway (self hosted uv-managed Python workspace on a persistent Ubuntu box template)

Your data stays yours on this template.

Why Deploy Ubuntu Python uv, the GitHub Codespaces alternative on Railway (Railway Free Trial)

Codespaces is polished, but you pay for compute hours and your environment lives on GitHub's terms.

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 Ubuntu Python uv 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 Ubuntu Python uv self hosting

Railway gives you the public domain, TLS and SSH proxy already wired, while a VPS gives you root but leaves the setup to you.

ProviderWhat You Get with RailwayWhat You Get with the Other Provider
DigitalOceanA /home volume, a web terminal domain and an SSH TCP proxy with no server to patchA full Droplet with root and systemd, but you install uv, set the firewall and keep the OS updated
AWSThe volume and domain wired up, with no VPC, security group or AMI choicesFine control over networking and instance types, plus the ops work that comes with it
HetznerA ready-made box with ttyd, sshd and tmux configured, billed as Railway usageLow-cost bare VMs with root, where you build the web terminal and SSH hardening yourself

Pick the option that matches how much server work you want to do.

Common Use Cases for hosted Ubuntu Python uv

  • Pinning uv for rebuilds: Install uv with a version-pinned URL such as curl -LsSf https://astral.sh/uv/0.13.6/install.sh | sh. The binary lands in ~/.local/bin on the persistent /home volume, so the same pin rebuilds the same uv.
  • Managing interpreters: Run uv python install 3.12 and uv python list to add and check a specific Python. The managed builds stay on /home, so you skip reinstalling them after a redeploy.
  • Long-running scrapers in tmux: Start a crawl with tmux new-session -A -s main, run uv run scrape.py inside it, then close the browser. Reattach later to check progress.
  • Locking a small project: Create one with uv init, add dependencies with uv add requests, and commit the generated uv.lock so the exact versions are recorded.
  • Ad hoc scripts: Run uv run example.py from the web terminal or an SSH session without activating a virtualenv by hand.

Dependencies for Ubuntu Python uv Docker hosted on Railway

This template is one Railway service named Ubuntu, built from the Ubuntu Web Terminal image, with no separate database or worker to wire up. ttyd serves the browser terminal, OpenSSH serves SSH, and tmux keeps your session alive.

Deployment Dependencies for Managed Ubuntu Python uv Service (ttyd + OpenSSH + tmux)

The service needs a public Railway domain for the browser terminal on port 7681, protected by HTTP basic auth. Attach a volume at /home.

Implementation Details for Ubuntu Python uv (Using Ubuntu Web Terminal official docker image)

The image is ghcr.io/onepush-dev/ubuntu-web-terminal:26.04-ttyd1.7.7, built on Ubuntu 26.04 with tini as PID 1. ttyd attaches to a tmux session named main, and interactive SSH logins join the same session.

How does Ubuntu Python uv compare against other ways to run Python projects in a browser-accessible Linux box

Ubuntu Python uv vs GitHub Codespaces (Codespaces Alternative)

  • Where Codespaces wins: It is a managed cloud dev environment with VS Code and repository integration, with no box to maintain.
  • Where Ubuntu Python uv wins: You get a real Ubuntu shell, with uv in ~/.local/bin on the /home volume so your uv binary and caches survive redeploys.
  • Gotcha: This is not a full VM. apt installs vanish on redeploy, so anything outside /home needs a forked Dockerfile.

Ubuntu Python uv vs PythonAnywhere (PythonAnywhere Alternative)

  • Where PythonAnywhere wins: It is built for hosting Python web apps and scheduled tasks with a browser console and little setup.
  • Where Ubuntu Python uv wins: You can install any Python version with uv python install and run shell tooling alongside your projects.
  • Gotcha: The box does not host your app publicly by default, so you wire up your own port and routing on the Railway domain.

Ubuntu Python uv vs Replit (Replit Alternative)

  • Where Replit wins: It is a browser IDE with built-in hosting for many languages, so you can reach a shareable URL quickly.
  • Where Ubuntu Python uv wins: You get a plain terminal with sshd, so you can use your own editor and key-based SSH.
  • Gotcha: There is no managed IDE or collaboration layer, so you bring your own editor and workflow.

Ubuntu Python uv vs DigitalOcean Droplet (Droplet Alternative)

  • Where a Droplet wins: You get a full VM with root access, systemd, Docker, and inbound UDP, which this box does not provide.
  • Where Ubuntu Python uv wins: There is no server to patch yourself, and keeping uv's Python builds on /home means redeploys do not force re-downloads.
  • Gotcha: The box is a container, not a VM, so anything needing systemd services or Docker-in-Docker is out of scope.

How to use Ubuntu Python uv (the OSS browser terminal and SSH box)?

  1. Open the Ubuntu service's Railway public domain and log in with the basic auth credentials; the password is TERMINAL_PASSWORD.
  2. Run the installer to put uv into ~/.local/bin, then confirm it is on your path.
  3. Install Python 3.12 with uv and check that uv can see it.
  4. Create a project folder, initialize it with uv, and add requests as a dependency.
  5. Run the project entry point or a script with uv run.
  6. For a long-running script, attach to the tmux session, start the script inside it, and detach so it keeps running after you close the browser.
curl -LsSf https://astral.sh/uv/install.sh | sh
which uv
uv python install 3.12
uv python list
mkdir hello-world
cd hello-world
uv init
uv add requests
uv run main.py
tmux new-session -A -s main
uv run example.py
# detach with Ctrl-b then d

How to self host Ubuntu Python uv on other VPS Services (Ubuntu Web Terminal self hosting guide)

Clone the Repository

Clone the Ubuntu Web Terminal repository onto a machine with Docker, then move into the folder.

git clone https://github.com/onepush-dev/ubuntu-web-terminal.git
cd ubuntu-web-terminal

Install Dependencies

You only need Docker on the VPS. The image bundles ttyd, OpenSSH, tmux, and the toolbox, so confirm Docker is running first.

docker info > /dev/null && echo "Docker is up"

Configure Environment Variables

Set TERMINAL_PASSWORD, which protects both the web terminal and SSH. Add your public key to SSH_AUTHORIZED_KEYS and turn off password SSH.

export TERMINAL_PASSWORD='choose-a-long-random-secret'
export SSH_AUTHORIZED_KEYS='ssh-ed25519 AAAA...your-key you@your-domain'
export SSH_PASSWORD_AUTH=false

Start the Ubuntu Python uv Application

Build the image and run it with a named volume on /home, so uv and its caches survive restarts. Then open http://your-domain:7681 and log in.

docker build -t ubuntu-python-uv .
docker run -d --restart always \
  -p 7681:7681 -p 2222:2222 \
  -e TERMINAL_PASSWORD -e SSH_AUTHORIZED_KEYS -e SSH_PASSWORD_AUTH \
  -v ubuntu-home:/home \
  ubuntu-python-uv

On your own VPS you handle TLS, firewalling, and restarts yourself, while Railway handles the public domain, TLS, the SSH TCP proxy, and the persistent volume for you.

Official Pricing of Ubuntu Python uv (Ubuntu Web Terminal pricing)

Ubuntu Python uv is free and open source under permissive licenses (ttyd MIT, tmux ISC, OpenSSH BSD-style, repo MIT).

Ubuntu Python uv cloud vs self hosted comparison (Pricing, features, costs, and more)

Self hosting this box on Railway means you pay only for Railway usage, since the software is free.

Monthly cost of self hosting Ubuntu Python uv on Railway

Your bill is Railway usage for one service plus the volume that holds /home. The template adds no license fee, because ttyd, tmux, and OpenSSH are free and open source.

System Requirements for Hosting Ubuntu Python uv on a VPS

On a VPS, plan for an x86_64 machine, since the bundled ttyd binary targets that architecture.

Frequently Asked Questions (FAQs)

Does uv survive a Railway redeploy?

Yes, if it lives on the persistent volume. Packages installed with apt do not.

Where does uv install, and why /home?

The standalone installer puts uv and uvx into ~/.local/bin, which sits under /home and so stays on the volume.

How do I keep a script running after I close the browser?

Start tmux with tmux new-session -A -s main, run uv run your-script.py inside it, then detach with the standard tmux keys.

How do I pin a uv version for rebuilds?

Put the version in the installer URL, such as curl -LsSf https://astral.sh/uv/0.13.6/install.sh | sh.

What is the difference between uv run and uv sync?

uv run checks the lock and environment, then runs your command without removing extraneous packages by default. uv sync makes the .venv match uv.lock exactly, which is the better choice when you want a clean environment.

How do I set up key-only SSH with SSH_AUTHORIZED_KEYS?

Add your public keys to SSH_AUTHORIZED_KEYS separated by semicolons, and set SSH_PASSWORD_AUTH to false.


Template Content

More templates in this category

View Template
NEW
Openfront Gym
Opensource Mindbody alternative based on Next.js and Keystone.js

Openship
0
View Template
open-excalidraw
Self-hostable collaborative drawing built on Excalidraw

Prateek Mohanty
5
View Template
Next.js + Prisma + PostgreSQL Starter
Deploy a Next.js app with Prisma ORM and PostgreSQL in one click.

blueorange
0