---
title: "Deploy Ubuntu ttyd Terminal"
description: "Browser terminal and SSH sharing one tmux session"
category: "Starters"
url: https://railway.com/deploy/deploy-ttyd-web-terminal-with-ssh
---

# Deploy Ubuntu ttyd Terminal

Browser terminal and SSH sharing one tmux session

**[Deploy Ubuntu ttyd Terminal on Railway](https://railway.com/template/deploy-ttyd-web-terminal-with-ssh)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-ttyd-web-terminal-with-ssh/manifest.json

- **Creator:** onepush
- **Category:** Starters

## Template content

### Ubuntu https://github.com/ubuntu.png

- **Image:** ghcr.io/onepush-dev/ubuntu-web-terminal:26.04-ttyd1.7.7
- **Public domain:** Yes

## Documentation

# Deploy and Host self hosted Ubuntu ttyd Terminal (ttyd Browser Terminal with SSH) on Railway

This template gives you a ttyd web terminal on Ubuntu 26.04 with tmux and SSH already wired, so you skip writing the ttyd flags yourself.

## About Hosting Ubuntu ttyd Terminal open-source software on Railway (self hosted ttyd web terminal on Ubuntu template)

ttyd shares a terminal over the web, and this template runs it as the browser front door to an Ubuntu 26.04 box.

You keep the data. The /home volume and SSH host keys stored there stay yours.

## Why Deploy Ubuntu ttyd Terminal, the Wetty alternative on Railway (Railway Free Trial)

Wetty means hosting a Node app yourself and keeping it patched. The $5 free trial is enough to test the browser shell and SSH through the TCP proxy first.

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 ttyd 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.

### Railway vs Other Hosting Providers and VPS for Ubuntu ttyd Terminal self hosting

Railway skips the box setup you would otherwise do yourself. Here is how it compares with a VPS.

| Provider | What You Get with Railway | What You Get with the Other Provider |
| --- | --- | --- |
| DigitalOcean | ttyd flags, basic auth and the SSH TCP proxy already wired. | A full Droplet with root access, but you write the Docker run line and firewall rules. |
| AWS | No VPC or security group setup before ttyd runs. | Deep networking control, but more console work and your own TLS and auth layer. |
| Hetzner | A working terminal without managing SSH keys or a systemd unit. | Cheap servers with generous bandwidth, but you handle updates and restarts. |

Pick Railway for a browser terminal running in minutes, and a VPS when you need a real machine underneath.

## Common Use Cases for hosted Ubuntu ttyd Terminal

- **Shell in any browser:** Open a full Ubuntu shell from any browser without installing an SSH client. ttyd serves it over HTTP with basic auth, so you only need the password from TERMINAL_PASSWORD.
- **One tmux session, two ways in:** The browser terminal and an SSH login both attach to the same tmux session named main. A job you start in the browser keeps running, and you can check it from SSH later.
- **Jump box on the Railway private network:** Use the box as a bastion for other services in the same project. You reach internal addresses from inside, so your databases never need a public port.
- **Demos and teaching:** Hand a student one URL and one password and they get a working Linux box with sudo. Set TTYD_MAX_CLIENTS to a small number to limit how many people share it at once.
- **Long jobs that survive closed tabs:** Start a backup or migration inside tmux and close the tab. The process keeps running on the container, and you reattach later to check progress.

## Dependencies for Ubuntu ttyd Terminal Docker hosted on Railway

This template runs as one Railway service named Ubuntu, built from ghcr.io/onepush-dev/ubuntu-web-terminal:26.04-ttyd1.7.7.

### Deployment Dependencies for Managed Ubuntu ttyd Terminal Service (ttyd + OpenSSH + tmux)

- **Railway account:** the single service runs on Railway, and you pay only for usage.
- **Public domain:** ttyd on port 7681, protected by HTTP basic auth.
- **TCP proxy:** needed for sshd on port 2222, giving a host and random port.
- **Volume at /home:** keeps your files and the SSH host keys.
- **TERMINAL_PASSWORD:** generated per deploy and shared by ttyd and SSH.

### Implementation Details for Ubuntu ttyd Terminal (Using Ubuntu Web Terminal official docker image)

The image is built on ubuntu:26.04 with a SHA-256 verified ttyd 1.7.7 binary and tini as PID 1. ttyd runs su - ubuntu then tmux new-session -A -s main, so browser clients and interactive SSH logins share one session.

## How does Ubuntu ttyd Terminal compare against other self-hosted web terminals

### Ubuntu ttyd Terminal vs Wetty (Wetty Alternative)

- **Runtime:** ttyd is a single C binary built on libuv and WebGL2, with no Node.js runtime to patch. Wetty runs on Node.
- **Where Wetty wins:** it is the more familiar name, with a long track record for SSH-in-browser setups.
- **Flags:** ttyd takes --credential, --writable and --ipv6 directly, which this template wires up for you.

### Ubuntu ttyd Terminal vs Shell In A Box (Shell In A Box Alternative)

- **Activity:** Shell In A Box is an older C project with little recent development, while ttyd still gets releases.
- **Where Shell In A Box wins:** it is very small, which can matter on tiny hosts.
- **Features:** ttyd supports several clients sharing one tmux session, which a plain login-shell-over-HTTP setup does not give you.

### Ubuntu ttyd Terminal vs GoTTY (GoTTY Alternative)

- **Language:** GoTTY is a Go binary and ttyd is C on libuv. Both ship as one executable, so deployment is similar.
- **Where GoTTY wins:** if you already work in Go, its codebase is pleasant to modify.
- **Client options:** ttyd sets client behavior with -t key=value pairs and caps concurrent sessions with --max-clients.

### Ubuntu ttyd Terminal vs Apache Guacamole (Guacamole Alternative)

- **Scope:** Guacamole is a clientless gateway for RDP, VNC and SSH, while ttyd only exposes a terminal. If you need a graphical desktop, Guacamole is the right tool.
- **Where Guacamole wins:** it covers far more protocols and gives you a full desktop in a browser tab.
- **Weight:** Guacamole needs guacd, a web application and usually a database, which is much heavier than one ttyd process with tmux and sshd behind it.

## How to use Ubuntu ttyd Terminal (the OSS browser terminal and SSH box)?

1. Deploy the template with no inputs and wait for the service.
2. Copy TERMINAL_PASSWORD from the service variables. It protects both the browser terminal and SSH.
3. Open the public URL and sign in as ubuntu. You land in a tmux session named main.
4. Detach with Ctrl-b then d. Reopen the URL later to reattach to the same session.
5. SSH through the TCP proxy host and port shown on the service. Interactive logins auto-attach to the same tmux session.
6. Compare with a plain ttyd container. `docker run -it --rm -p 7681:7681 tsl0922/ttyd bash` has no auth and no writable flag, so you add `--credential` and `--writable` yourself. This template passes both already.

```bash
# Plain ttyd in Docker: you add the flags yourself
docker run -it --rm -p 7681:7681 tsl0922/ttyd bash

# SSH through the Railway TCP proxy
ssh -p  ubuntu@
```

## How to self host Ubuntu ttyd Terminal on other VPS Services (Ubuntu Web Terminal self hosting guide)

Running this on your own VPS takes one Docker image and a few environment variables.

### Clone the Repository

Clone the source so you can read the Dockerfile and entrypoint first.

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

### Install Dependencies

You only need Docker on the host. The image pins Ubuntu 26.04 and ships the ttyd 1.7.7 binary.

```bash
sudo apt-get update &amp;&amp; sudo apt-get install -y docker.io
```

### Configure Environment Variables

Set a real password first, since the entrypoint refuses to start with an empty one.

```bash
export TERMINAL_PASSWORD=your-long-random-secret
export TTYD_FONT_SIZE=15
export TTYD_MAX_CLIENTS=0
```

### Start the Ubuntu ttyd Terminal Application

Run the image with ports 7681 and 2222, and mount a volume at /home so files and SSH host keys survive restarts.

```bash
docker run -d --name ubuntu-ttyd -p 7681:7681 -p 2222:2222 \
  -e TERMINAL_PASSWORD -e TTYD_FONT_SIZE -e TTYD_MAX_CLIENTS \
  -v ttyd-home:/home ghcr.io/onepush-dev/ubuntu-web-terminal:26.04-ttyd1.7.7
```

Put a TLS reverse proxy in front of port 7681 for your-domain, then connect with `ssh -p 2222 ubuntu@your-domain`.

## Official Pricing of Ubuntu ttyd Terminal (Ubuntu Web Terminal pricing)

Ubuntu ttyd Terminal is free and open source. You pay only for the infrastructure you run it on. Ubuntu is a Canonical trademark, but using the image costs nothing.

## Ubuntu ttyd Terminal cloud vs self hosted comparison (Pricing, features, costs, and more)

Running this template on Railway versus hosting the same stack yourself comes down to what you pay for and what you have to maintain.

### Monthly cost of self hosting Ubuntu ttyd Terminal on Railway

All software in this template is free: ttyd is MIT licensed, tmux is ISC, OpenSSH is BSD style, and the repo is MIT.

### System Requirements for Hosting Ubuntu ttyd Terminal on a VPS

On a VPS you need an x86_64 Linux host, since the pinned ttyd 1.7.7 binary is an x86_64 static build, and enough memory and disk for Ubuntu 26.04 plus your own work.

## Frequently Asked Questions (FAQs)

### Why is the terminal writable, and can I make it read only?

This template passes `--writable` to ttyd, because without it ttyd is view only by default.

### How does basic auth work here?

ttyd checks a `--credential user:password` pair before it serves the page or opens the websocket.

### How do I change font size or other client options?

TTYD_FONT_SIZE=15 sets the browser font size in this template.

### What does max clients do?

TTYD_MAX_CLIENTS caps concurrent browser clients, and the default of 0 means no limit. Set it to a positive number if you want to stop extra tabs from attaching to the same shell.

### How is ttyd different from Wetty?

ttyd serves a single command over a websocket in a browser tab, while Wetty is a Node app that gives you an SSH style login in the browser.

### Can I run ttyd without tmux?

Yes, but you lose the shared session that lets your browser and SSH clients see the same shell.


## Similar templates

- [Openfront Gym](https://railway.com/deploy/openfront-gym) — Opensource Mindbody alternative based on Next.js and Keystone.js
- [open-excalidraw](https://railway.com/deploy/open-excalidraw) — Self-hostable collaborative drawing built on Excalidraw
- [Next.js + Prisma + PostgreSQL Starter](https://railway.com/deploy/nextjs-prisma-postgres) — Deploy a Next.js app with Prisma ORM and PostgreSQL in one click.

Open this page in a browser: https://railway.com/deploy/deploy-ttyd-web-terminal-with-ssh
