
ttyd
A command-line tool that shares a terminal session in a web browser.
- Stars
- 12.6k
- Forks
- 1.2k
- Licence
- MIT
- Language
- C
- Last update
- 3 months ago
- Type
- Dev tool
What it is
ttyd runs a command on your machine and serves it as a terminal you can open in a web browser. You start it from the command line, and anyone with the address (and credentials, if you set them) can see and, if you allow it, type into that terminal. People use it to reach a shell or program from another device without a native terminal client.
- Open a shell on a home server from a phone or laptop browser
- Run a single command-line program, such as a monitoring tool, and view it in a browser
- Let a colleague watch or, with the writable flag, type into your terminal session
- Serve a terminal behind a reverse proxy using the base-path or auth-header options
- Transfer files through the browser using ZMODEM or trzsz support
Great for
- Developers who want to open a shell on a home server or device from a browser
- People running tools on OpenWrt routers or other small Linux boxes
- Anyone who needs quick browser access to a command-line program on a local network
- Users who want a terminal in a browser with file transfer or image output support
Not ideal for
- Anyone exposing a terminal to the internet without strong authentication, since the README describes basic auth and SSL options but the security risk of a shared shell is significant
- Users who only want an SSH-style remote login; the README lists Wetty as an SSH/login-based alternative
- People who need a full multi-user web-based IDE, as ttyd focuses on the terminal itself
How to get it
- 1
Install with a package manager
Install with Homebrew on macOS
brew install ttydInstall on Debian/Ubuntu
sudo apt install ttydInstall with WinGet on Windows
winget install tsl0922.ttydInstall with Scoop on Windows
scoop install ttyd - 2
Run it
- Install ttyd using one of the package manager commands for your system
- Run ttyd with a command, for example: ttyd [options] <command>
- Set a port with -p if you do not want the default 7681
- Open the printed address in a browser to see the terminal
- Add -W only if you want browser clients to be able to type
- 3
Get the most out of it
- Set credentials with -c username:password for basic authentication
- Use -S with -C and -K to enable SSL with your own certificate and key
- Use -b to run behind a reverse proxy at a sub-path
- Use -m to limit the number of clients or -o to accept a single client
- Use -B to open the terminal in your default browser automatically
Downloads
Strengths
- Written in C on top of libuv and WebGL2, aiming for speed according to the README
- Supports CJK text, IME input, SSL, and basic authentication
- Available through many package managers on macOS, Linux, Windows, and OpenWrt
Trade-offs
- Sharing a shell over the web carries real security risk, so configuration must be done carefully
- The README is brief and points to the wiki for usage examples
- Read-only by default; write access must be enabled explicitly with a flag
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| ttyd (this) | 12.6k | Dev tool | intermediate | 3 months ago | Developers who want to open a shell on a home server or device from a browser |
| gotty | 19.6k | Dev tool | beginner | 2.3 years ago | Developers who want to show a running terminal session to someone in a browser |
| xterm.js | 21.3k | Library | intermediate | 7 days ago | Developers building a browser-based IDE or cloud workspace that needs an integrated terminal |
| upterm | 19k | App | intermediate | 7.5 years ago | Developers who want to try an Electron-based terminal with autocompletion |
| tabby | 75.3k | App | beginner | 4 days ago | Developers who keep many SSH sessions open and want them saved and organized |
| mitmproxy | 46.6k | Dev tool | intermediate | 4 days ago | Developers debugging how an app talks to a backend API |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.