Repolode
tsl0922

tsl0922/ttyd

A command-line tool that shares any terminal program over the web through a browser-based xterm.js terminal.

Stars
12,536
Forks
1,212
Open issues
122
Last commit
2 months ago

What is it?

ttyd runs a command in a pseudo-terminal and serves it over HTTP and WebSocket, so anyone with the link can view and, if allowed, type into the session from a browser. It is written in C on top of libuv, and the browser side uses xterm.js with WebGL2 rendering.

The tool supports CJK characters and IME input, ZMODEM and trzsz file transfer, and Sixel image output. Access can be protected with basic authentication, an authentication header for a reverse proxy, client certificates, or SSL through OpenSSL or Mbed TLS. Options control the port or UNIX socket, the user and group the command runs as, read-only versus writable mode, and client limits.

Built binaries and packages are available for macOS, Linux, FreeBSD, OpenBSD, OpenWrt and Windows.

Key features

  • 01Shares any command-line program in the browser via xterm.js with WebGL2 rendering.
  • 02Supports CJK characters and IME input.
  • 03Provides ZMODEM and trzsz file transfer.
  • 04Outputs Sixel images.
  • 05Offers basic auth, auth-proxy headers, client certificates and SSL.
  • 06Runs on macOS, Linux, BSD, OpenWrt and Windows.

Use cases

  • Giving a colleague or support engineer temporary browser access to a shell session.
  • Running a web-accessible terminal on a router or home server running OpenWrt.
  • Exposing a long-running CLI tool or monitoring command through a web page.

Quick start

  1. 1

    Install with Homebrew on macOS

    brew install ttyd
  2. 2

    Install on Debian/Ubuntu

    sudo apt install ttyd
  3. 3

    Install on Windows with WinGet

    winget install tsl0922.ttyd

Things to know

  • Some install routes (Gentoo, Windows compilation) require manual steps beyond a single command.

In collections

Topics

FAQ

What is ttyd?
A command-line tool that shares any terminal program over the web through a browser-based xterm.js terminal. ttyd runs a command in a pseudo-terminal and serves it over HTTP and WebSocket, so anyone with the link can view and, if allowed, type into the session from a browser. It is written in C on top of libuv, and the browser side uses xterm.js with WebGL2 rendering.
Is ttyd free to use? What license does it have?
ttyd is open source under the MIT license. Check the license terms before using it in commercial products.
Is ttyd still maintained?
Updated within 6 months. The last commit to ttyd was on Aug 12, 2026.
What can I use ttyd for?
Giving a colleague or support engineer temporary browser access to a shell session. Running a web-accessible terminal on a router or home server running OpenWrt. Exposing a long-running CLI tool or monitoring command through a web page.
How do I install ttyd?
Install with Homebrew on macOS: brew install ttyd Install on Debian/Ubuntu: sudo apt install ttyd Install on Windows with WinGet: winget install tsl0922.ttyd
Where can I get ttyd?
The source code and installation instructions are on GitHub: https://github.com/tsl0922/ttyd

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects