dumbwareio/dumbterm

Sponsored OSS

By DumbWareio

Updated 10 months ago

A stupidly simple web-based terminal emulator, with common tools and Starship enabled!

Image
1

100K+

dumbwareio/dumbterm repository overview

DumbTerm

A stupidly simple web-based terminal emulator, with common tools and Starship enabled! 🚀

dumbterm-preview

  • Access your terminal from any device with a web browser
  • Execute commands just like in a native terminal
  • Starship prompt provides a beautiful terminal experience with git status, command duration, etc.
  • PIN protection (recommended) prevents unauthorized access
  • Use the data directory to persist files between container restarts
  • Demo mode available for testing and demonstrations - simulated terminal (set DEMO_MODE=true)

Use cases:

  • Build with docker: To create a sandboxed environment for testing scripts, code, applications, emulate a VPS, showcase examples and more. All without having to install dependencies on your local machine!
  • Build locally: To access your client's cli/terminal through your browser instead!
  • Self-hosting: Put behind a reverse proxy, auth provider (like authentik, authelia, etc), Cloudflare tunnels with application access rules, etc for secure external access.
  • Another alternative to web terminals such as ttyd, shellinabox, etc

Table of Contents

Features

  • 🖥️ Web-based terminal access from anywhere
  • 🌙 Dark mode support
  • 📱 Responsive design for mobile and desktop
  • 🐳 Docker support (Debian-based container)
  • 🔧 Pre-installed utilities: starship, nerdfonts, apt-utils, curl, wget, ssh, git, vim, nano, htop, net-tools, iputils-ping, traceroute, fontconfig, unzip, locales.
  • 🔒 Optional PIN protection (numeric)
  • ✨ Starship prompt integration for beautiful terminal experience
  • 🔍 Terminal search functionality (ctrl+f or cmd+f)
  • 📂 Custom volume mappings
  • 🔗 In-terminal hyperlinks
  • ⌨️ Keyboard shortcuts for common actions
  • 📑 Tab Management:
    • Drag and drop reordering of tabs
    • Double-click to rename tabs
    • Direct tab selection with shortcuts
    • Terminal history persistence across sessions
  • 📱 PWA Support for mobile and desktop
  • ⚡ XTerm.js for fast terminal rendering

Quick Start

Prerequisites
Option 1: Docker (For Dummies)
  • Docker method uses a pre-installed Debian Bullseye-based container/environment.
# Pull and run with one command
docker run -p 3000:3000 \
  -v ./data:/root/data \
  -v ./config:/root/.config \ 
  -e DUMBTERM_PIN=1234 \
  -e SITE_TITLE=DumbTerm \
  -e BASE_URL=http://localhost:3000 \
  -e ALLOWED_ORIGINS=http://localhost:3000 \
  -e ENABLE_STARSHIP=true \
  -e TZ=America/Los_Angeles \
  -e LOCKOUT_TIME=15 \
  -e MAX_SESSION_AGE=24 \
  dumbwareio/dumbterm:latest
  1. Go to http://localhost:3000
  2. Enter your PIN if configured
  3. Enjoy your web-based terminal!

Create a docker-compose.yml file or use the provided one:

services:
  dumbterm:
    image: dumbwareio/dumbterm:latest
    container_name: dumbterm
    restart: unless-stopped
    ports:
      - ${DUMBTERM_PORT:-3000}:3000
    volumes:
      - ${DUMBTERM_CONFIG:-./config}:/root/.config
      - ${DUMBTERM_DATA_DIR:-./data}:/root/data
    environment:
      # Container timezone
      TZ: ${DUMBTERM_TZ:-America/Los_Angeles}
      # The title shown in the web interface
      SITE_TITLE: ${DUMBTERM_SITE_TITLE:-DumbTerm}
      # Recommended PIN protection (leave empty to disable)
      DUMBTERM_PIN: ${DUMBTERM_PIN:-1234}
      # The base URL for the application
      BASE_URL: ${DUMBTERM_BASE_URL:-http://localhost:3000}
      ENABLE_STARSHIP: ${ENABLE_STARSHIP:-true}
      LOCKOUT_TIME: ${DUMBTERM_LOCKOUT_TIME:-15} # Minutes
      # Session duration in hours before requiring re-authentication
      MAX_SESSION_AGE: ${DUMBTERM_MAX_SESSION_AGE:-24} # Hours
      # (OPTIONAL) - List of allowed origins for CORS
      # ALLOWED_ORIGINS: ${DUMBTERM_ALLOWED_ORIGINS:-http://localhost:3000}

Then run:

docker compose up -d
Option 3: Running Locally (For Developers)
  • Local method will use your local terminal environment (Windows: Powershell, Mac / Linux: bash).
  1. Install dependencies:
npm install

Tip

#### Windows specific: - If you encounter issues with `node-pty` you can try using [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/install) or may need to install: - `Node.js v16` (Look into [nvm for windows](https://github.com/coreybutler/nvm-windows) for multi node version support): - `winget install CoreyButler.NVMforWindows` - with nvm installed use: `nvm install 16 && nvm use 16` - `windows-build-tools` through Visual Studio Installer `MSVC v142 - VS 2019 C++ {arch} Build Tools` - Contact us or View the [official Microsoft documentation](https://github.com/microsoft/node-pty?tab=readme-ov-file#windows) for more details
  1. cp .env.example .env > Set environment variables in .env:
PORT=3000                  # Port to run the server on
DUMBTERM_PIN=1234          # Optional PIN protection
SITE_TITLE=DumbTerm        # Custom site title
BASE_URL=http://localhost:3000  # Base URL for the application
  1. Start the server:
npm start

Configuration

Environment Variables
VariableDescriptionDefaultRequired
PORTServer port3000No
BASE_URLBase URL for the applicationhttp://localhost:PORTNo
DUMBTERM_PINPIN protection (numeric)NoneNo
SITE_TITLESite title displayed in headerDumbTermNo
TZContainer timezoneAmerica/Los_AngelesNo
ENABLE_STARSHIPEnable Starship prompt (docker only)trueNo
NODE_ENVNode environment mode (development or production)productionNo
ALLOWED_ORIGINSAllowed CORS origins (comma-separated list)* (all origins)No
DEBUGEnable debug loggingFALSENo
LOCKOUT_TIMECustom Pin Lockout Time (in minutes)15No
MAX_SESSION_AGEDuration of authenticated session (in hours)24No
DEMO_MODEEnable demo mode with simulated terminalfalseNo
Starship usage
  • Starship is a cross-shell prompt that provides a beautiful terminal experience.
  • It is enabled by default in the Docker image and is the recommended method.
  • To disable it, set ENABLE_STARSHIP to false in your environment variables.
  • You can customize the Starship prompt by using one of the following steps:
1. Use a preset configuration from starship.
Starship Presets:

Tip

copy and paste one of the starship preset commands below into DumbTerm and that's it!
Example Preset Command:

preset-preview


Warning

**Note:** If running locally or mapped volume to your actual `starship.toml` config, the preset commands will overwrite your existing `starship.toml` file. Make sure to back it up as needed.
View All Starship Presets:
Preset NameCommandPreview
Nerd Font Symbolsstarship preset nerd-font-symbols -o ~/.config/starship.tomlNerd Font Symbols
Bracketed Segmentsstarship preset bracketed-segments -o ~/.config/starship.tomlBracketed Segments
Plain Text Symbolsstarship preset plain-text-symbols -o ~/.config/starship.tomlPlain Text Symbols
No Runtime Versionsstarship preset no-runtime-versions -o ~/.config/starship.tomlNo Runtime Versions
No Empty Iconsstarship preset no-empty-icons -o ~/.config/starship.tomlNo Empty Icons
Pure Promptstarship preset pure-preset -o ~/.config/starship.tomlPure Prompt
Pastel Powerlinestarship preset pastel-powerline -o ~/.config/starship.tomlPastel Powerline
Tokyo Night (DumbTerm Default with mods)starship preset tokyo-night -o ~/.config/starship.tomlTokyo Night
Gruvbox Rainbowstarship preset gruvbox-rainbow -o ~/.config/starship.tomlGruvbox Rainbow
Jetpackstarship preset jetpack -o ~/.config/starship.tomlJetpack
No Nerd Fontsstarship preset no-nerd-font -o ~/.config/starship.tomln/a
  • You can also view the available presets by running starship preset -l in DumbTerm.

For more details, visit the Starship Presets page.

2. Modify the ~/.config/starship.toml file in your set volume mount or within the container.
  • The default configuration is located in /root/.config/starship.toml.
  • You can also mount a custom starship.toml file to the container using Docker volumes.
  • Update or add your custom configurations to starship.toml.
3. Running locally
  • If you are running DumbTerm locally, DumbTerm will inherit your current styles.
    • Meaning if you already have starship enabled locally, you should be able to see your current styles accordingly.
  • You must install Starship on your local machine if you wish to use DumbTerm with starship locally.

Keyboard Shortcuts

DumbTerm provides a comprehensive set of keyboard shortcuts for efficient terminal management. The modifier keys vary by operating system:

  • Windows/Linux: Ctrl+Alt+{key}
  • macOS: Ctrl+Cmd+{key}
ActionWindows/LinuxmacOS
New TerminalCtrl+Alt+TCtrl+Cmd+T
Close TerminalCtrl+Alt+WCtrl+Cmd+W
Rename TerminalCtrl+Alt+RCtrl+Cmd+R
Search in TerminalCtrl+FCmd+F
Next TerminalCtrl+Alt+> or Ctrl+Alt+.Ctrl+Cmd+> or Ctrl+Cmd+.
Previous TerminalCtrl+Alt+< or Ctrl+Alt+,Ctrl+Cmd+< or Ctrl+Cmd+,
Switch to Terminal 1-9Ctrl+Alt+[1-9]Ctrl+Cmd+[1-9]
  • Press Ctrl+F (Windows/Linux) or Cmd+F (macOS) to open the search bar
  • Use Up/Down arrow buttons or Enter/Shift+Enter to cycle through matches
  • Press Escape or the close button to exit search mode
Tab Management
  • Drag and Drop: Click and drag tabs to reorder them
  • Rename: Double-click a tab or use the keyboard shortcut to rename it
  • History: Terminal content is automatically preserved across browser refreshes and restarts
  • Direct Selection: Use number shortcuts (1-9) to quickly switch between the first 9 terminals

Security

It is highly recommended to set a strong PIN, use HTTPS, use ALLOWED_ORIGINS, and integrate with an auth provider (i.e. Authentik / Authelia / tinyauth, etc).

We're dumb, but not stupid. Use a full-featured auth provider for production use.

Features
  • Variable-length PIN support (numeric)
  • Constant-time PIN comparison
  • Brute force protection:
    • 5 attempts maximum
    • 15-minute lockout after failed attempts
    • IP-based tracking
  • Secure cookie handling
  • Session-based authentication
  • CORS support for origin restrictions (optional)
  • HTTPS support (when configured with proper BASE_URL)

Technical Details

Stack
  • Backend: Node.js (>=20.0.0) with Express
  • Frontend: XTerm.js for terminal emulation
  • Container: Docker with Debian Bullseye base
  • Terminal: node-pty for process spawning
  • Communication: WebSockets for real-time terminal I/O
  • Security: cors for cross-origin requests
Dependencies
  • express: Web framework
  • node-pty: Terminal process spawning
  • xterm: Terminal frontend
  • ws: WebSocket server
  • cookie-parser: Cookie handling
  • express-session: Session management
  • cors: security for cross-origin requests
Supported XTerm Addons

DumbTerm includes the following XTerm.js addons to enhance your terminal experience:

AddonDescription
@xterm/addon-attachAttaches a terminal session to a websocket
@xterm/addon-canvasRenderer that uses canvas to draw terminal content (used as fallback after webgl)
@xterm/addon-clipboardClipboard integration for copy/paste support
@xterm/addon-fitAutomatically resize terminal to fit its container
@xterm/addon-imageDisplay images inline in the terminal
@xterm/addon-ligaturesFont ligatures support
@xterm/addon-searchSearch text in the terminal buffer
@xterm/addon-serializeSerialize terminal output to string or HTML
@xterm/addon-unicode11Additional Unicode 11 character width support
@xterm/addon-web-linksAutomatically hyperlink URLs in terminal
@xterm/addon-webglRenderer that uses WebGL for better performance (default render method)

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes using conventional commits
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

See Development Guide for local setup and guidelines.


Made with ❤️ by DumbWareio & gitmotion

🌐 Check Us Out

Future Features

  • Additional authentication methods

Got an idea? Open an issue or submit a PR

Tag summary

Content type

Image

Digest

sha256:5c501c542

Size

293.7 MB

Last updated

10 months ago

docker pull dumbwareio/dumbterm

This week's pulls

Pulls:

3,988

Last week