Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsMay 17, 2026·3 min de lectura

ttyd — Share Your Terminal over the Web

ttyd is a lightweight tool that turns a terminal session into a web application, allowing browser-based access to any command-line program.

Listo para agents

Este activo puede ser leído e instalado directamente por agents

TokRepo expone un comando CLI universal, contrato de instalación, metadata JSON, plan según adaptador y contenido raw para que los agents evalúen compatibilidad, riesgo y próximos pasos.

Needs Confirmation · 66/100Política: confirmar
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
ttyd Overview
Comando CLI universal
npx tokrepo install 134a2cb4-51c9-11f1-9bc6-00163e2b0d79

Introduction

ttyd exposes a terminal session as a web page, letting anyone with a browser interact with a command-line program running on a remote machine. It is useful for sharing shells, running interactive tools in kiosk mode, or building browser-based terminal interfaces.

What ttyd Does

  • Serves any terminal program (bash, htop, vim, etc.) via a web browser
  • Uses WebSocket for low-latency bidirectional communication
  • Supports multiple concurrent client connections
  • Provides read-only mode for safe observation without input
  • Works with SSL/TLS for encrypted sessions

Architecture Overview

ttyd is written in C and uses libwebsockets for the WebSocket server and xterm.js for the browser-side terminal emulator. When a client connects, ttyd spawns a new pseudo-terminal (pty) running the specified command and bridges I/O between the pty and the WebSocket. The binary is small and has minimal runtime dependencies.

Self-Hosting & Configuration

  • Install via Homebrew, apt, or download a static binary from Releases
  • Run ttyd <command> to start the server on port 7681
  • Use -p to change the listening port and -i to bind to a specific interface
  • Enable TLS with --ssl-cert and --ssl-key for production deployments
  • Add basic authentication with -c username:password

Key Features

  • Sub-megabyte static binary that compiles on Linux, macOS, and FreeBSD
  • Full terminal emulation in the browser via xterm.js, including 256-color and Unicode
  • Read-only mode (-R) for safe live-streaming of terminal output
  • Client-side URL arguments to set terminal size, font, and theme
  • Can run behind a reverse proxy (Nginx, Caddy) with WebSocket pass-through

Comparison with Similar Tools

  • sshx — collaborative terminal sharing with multiplayer cursors; ttyd is a simpler one-command web terminal
  • Gotty — similar concept but unmaintained since 2017; ttyd is actively developed
  • Wetty — Node.js-based web terminal tied to SSH; ttyd is a lightweight C binary serving any command
  • Shellinabox — legacy web terminal; ttyd offers modern xterm.js rendering and WebSocket transport

FAQ

Q: Can multiple users connect at the same time? A: Yes. Each connection gets its own pty by default. Use --once to limit to a single session.

Q: Is it safe to expose ttyd to the internet? A: Use TLS and authentication at minimum. For public use, place it behind a reverse proxy with additional access controls.

Q: Does it support copy and paste? A: Yes. The xterm.js frontend supports clipboard integration in modern browsers.

Q: Can I customize the web UI appearance? A: Yes. Pass xterm.js options via URL query parameters or use a custom index.html with --base-path.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados