Skip to content

vpbgkt/termi-host

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

termi-host

termi-host logo License: MIT Node.js PRs Welcome

Free and Open Source Web-Based Terminal Access

Access your VPS/server terminal from any browser, anywhere in the world

πŸš€ Live Demo | πŸ“– Documentation | πŸ”§ Troubleshooting | πŸ› Report Bug | ✨ Request Feature


🎯 What is termi-host?

termi-host is a free, open-source web-based terminal solution that lets you access your server terminal through any web browser. No SSH client installation needed. Perfect for:

  • πŸ“± Accessing servers from mobile devices
  • πŸ“Ί Using terminals on smart TVs
  • πŸ’» Managing servers from public computers without SSH clients
  • 🌍 Remote server administration from anywhere
  • πŸŽ“ Educational environments and coding tutorials
  • 🏒 Team collaboration and pair programming

✨ Key Features

🌟 Core Features

  • 🌐 Browser-Based Terminal: No SSH client needed - works in Chrome, Firefox, Safari, Edge
  • πŸ”’ Optional Authentication: Built-in password protection (configurable)
  • ⚑ Real-time Communication: WebSocket-based for instant command execution
  • 🎨 Modern UI: Beautiful terminal interface powered by xterm.js
  • πŸ“± Fully Responsive: Works seamlessly on desktop, tablet, and mobile
  • πŸš€ Lightweight: Minimal resource footprint (~50MB RAM)
  • πŸ”§ Easy Configuration: JSON-based config with environment variable support
  • 🐚 Multi-Shell Support: Works with bash, zsh, sh, and more
  • 🎯 Zero Dependencies: Just Node.js - no database or additional services needed

πŸ› οΈ Technical Features

  • πŸ“¦ Easy Deployment: Single command installation
  • πŸ”„ Auto-Reconnect: Automatic reconnection on network issues
  • πŸ–₯️ PTY Support: Full pseudo-terminal with proper signal handling
  • 🎨 Terminal Colors: Full ANSI color support
  • ⌨️ Special Keys: All keyboard shortcuts work (Ctrl+C, Ctrl+Z, etc.)
  • πŸ“ Dynamic Resize: Terminal auto-resizes with browser window
  • πŸ” SELinux Compatible: Works with security-enhanced Linux
  • πŸ“Š Systemd Integration: Run as a system service with auto-restart

πŸš€ Quick Start

Automated Installation (Recommended)

The easiest way to get started is using our automated installation script:

# Clone and install with one command
git clone https://github.com/vpbgkt/termi-host.git && cd termi-host && bash install.sh

The script will:

  • βœ… Check your Node.js version (and install Node.js 20 if needed)
  • βœ… Install build tools required for node-pty
  • βœ… Install all npm dependencies automatically
  • βœ… Create default configuration file
  • βœ… Generate secure session secret

Then start the server:

npm start

Manual Installation

If you prefer manual installation:

# 1. Clone the repository
git clone https://github.com/vpbgkt/termi-host.git
cd termi-host

# 2. Run the installation script
bash install.sh

# 3. Start the server
npm start

That's it! Open your browser to:

  • Local: http://localhost:3000
  • Remote: http://YOUR_SERVER_IP:3000

Default Login:

  • Username: admin
  • Password: admin (⚠️ CHANGE THIS!)

πŸ“¦ Installation

Automated Installation Script

The easiest and recommended method:

# Clone and run installation script
git clone https://github.com/vpbgkt/termi-host.git
cd termi-host
bash install.sh

The install.sh script will:

  1. βœ… Detect your operating system
  2. βœ… Check Node.js version (requires >= 18.0.0)
  3. βœ… Offer to install Node.js 20 LTS if needed
  4. βœ… Install build tools (gcc, make, python3) if missing
  5. βœ… Install all npm dependencies
  6. βœ… Create default configuration with secure session secret
  7. βœ… Display next steps and access information

Supported Operating Systems:

  • Ubuntu/Debian
  • CentOS/RHEL/AlmaLinux/Rocky Linux
  • Fedora
  • Other Linux distributions (with manual Node.js installation)

Manual Installation

If you already have Node.js >= 18.0.0 and build tools installed:

# Clone repository
git clone https://github.com/vpbgkt/termi-host.git
cd termi-host

# Install dependencies
npm install

# Create configuration (optional, will use defaults)
cp config/local.json.example config/local.json

# Start server
npm start

Prerequisites (Manual Setup)

  • Node.js 18.0.0 or higher (Download)
  • npm (comes with Node.js)
  • Operating System: Linux, macOS, or Windows with WSL
  • Build tools (for node-pty compilation):
    • Linux: build-essential python3 make gcc g++
    • macOS: Xcode Command Line Tools
    • Windows: Visual Studio Build Tools

Install Build Tools Manually

# Ubuntu/Debian
sudo apt update
sudo apt install -y build-essential python3 make g++

# CentOS/RHEL/AlmaLinux
sudo yum groupinstall -y "Development Tools"
sudo yum install -y python3 make gcc gcc-c++

# Fedora
sudo dnf groupinstall -y "Development Tools"
sudo dnf install -y python3 make gcc gcc-c++

Install as System Service (Linux)

Using the installation script (recommended):

sudo bash install.sh --service

This will automatically:

  • Create systemd service file
  • Enable service to start on boot
  • Start the service immediately
  • Display service status and management commands

Manual service installation:

# Create systemd service
sudo tee /etc/systemd/system/termi-host.service > /dev/null <<EOF
[Unit]
Description=termi-host Web Terminal
Documentation=https://github.com/vpbgkt/termi-host
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=$(pwd)
ExecStart=$(which node) $(pwd)/src/server.js
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
EOF

# Enable and start service
sudo systemctl daemon-reload
sudo systemctl enable termi-host
sudo systemctl start termi-host

# Check status
sudo systemctl status termi-host

Service Management Commands:

# Start service
sudo systemctl start termi-host

# Stop service
sudo systemctl stop termi-host

# Restart service
sudo systemctl restart termi-host

# Check status
sudo systemctl status termi-host

# View logs
sudo journalctl -u termi-host -f

βš™οΈ Configuration

termi-host can be configured via JSON files or environment variables.

Basic Configuration

Create a local configuration file:

cp config/local.json.example config/local.json

Edit config/local.json:

{
  "server": {
    "port": 3000,
    "host": "0.0.0.0"
  },
  "terminal": {
    "shell": "bash",
    "cols": 80,
    "rows": 24
  },
  "authentication": {
    "enabled": false,
    "username": "admin",
    "password": "admin"
  }
}

Environment Variables

PORT=8080 AUTH_ENABLED=true AUTH_PASSWORD=secret npm start

See Configuration Guide for detailed options.

❓ Troubleshooting

Having issues? Check our Troubleshooting Guide for:

  • Node.js version problems
  • Build tool errors
  • Module not found errors
  • Connection issues
  • And more...

Common quick fixes:

# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install

# Use automated installer
bash install.sh

# Check logs (if running as service)
sudo journalctl -u termi-host -f

πŸ”’ Security

⚠️ Authentication is now ENABLED by default!

Default credentials (CHANGE THESE!):

  • Username: admin
  • Password: admin

To change credentials:

  1. Create config/local.json:

    {
      "authentication": {
        "enabled": true,
        "username": "your-username",
        "password": "your-strong-password",
        "sessionSecret": "generate-random-string-here"
      }
    }
  2. Restart the server:

    npm start
    # OR if using systemd:
    sudo systemctl restart termi-host

Generate a secure session secret:

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

Example: Secure Setup with nginx

server {
    listen 443 ssl;
    server_name terminal.example.com;
    
    ssl_certificate /path/to/cert.pem;
    ssl_certificate_key /path/to/key.pem;
    
    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

πŸ› οΈ Development

# Clone the repo
git clone https://github.com/vpbgkt/termi-host.git
cd termi-host

# Install dependencies
npm install

# Run in development mode
npm run dev

πŸ“– Documentation

🀝 Contributing

Contributions are welcome! This project aims to have implementations in multiple languages (Python, Go, Rust, etc.).

See CONTRIBUTING.md for guidelines (Coming Soon).

πŸ—ΊοΈ Roadmap

  • Core terminal functionality
  • WebSocket communication
  • Configuration system
  • Authentication implementation
  • Multi-session support
  • File upload/download
  • Terminal recording
  • Python implementation
  • Go implementation
  • Docker image
  • npm package

🌟 Use Cases

  • Remote Server Management: Access your VPS from anywhere
  • DevOps & SysAdmin: Quick server access without SSH client
  • Education: Teaching Linux/command-line to students
  • IoT & Embedded: Access Raspberry Pi and embedded devices
  • Emergency Access: When you don't have your SSH keys
  • Mobile Administration: Manage servers from your phone
  • Team Collaboration: Share terminal access with team members
  • Customer Support: Help users debug issues remotely

πŸ” Keywords

web terminal, browser terminal, online terminal, web ssh, browser ssh, remote terminal access, web-based terminal, online ssh client, terminal emulator, xterm.js, node-pty, websocket terminal, cloud terminal, vps terminal, server terminal, linux terminal browser, terminal web interface, ssh web client, web console, remote shell access

πŸ“Š Comparison

Feature termi-host ttyd wetty shellinabox
Installation ⭐ Easy Medium Medium Medium
Dependencies Node.js only C/libwebsockets Node.js C/OpenSSL
Authentication βœ… Optional βœ… Yes βœ… Yes βœ… Yes
Configuration βœ… JSON/Env Command-line Command-line Command-line
WebSocket βœ… Yes βœ… Yes βœ… Yes No
Mobile Support βœ… Excellent Good Good Fair
Active Development βœ… Active Active Active Inactive

🀝 Contributing

Contributions are welcome! We're planning implementations in multiple languages.

See CONTRIBUTING.md for guidelines.

Roadmap:

  • Node.js implementation
  • Python implementation
  • Go implementation
  • Rust implementation
  • Docker image
  • npm package
  • Multi-session support
  • File upload/download

πŸ“„ License

MIT License - see LICENSE file for details.

Free and open source forever! ❀️

πŸ‘₯ Author & Contributors

Created with ❀️ by @vpbgkt

Want to contribute? Check out CONTRIBUTING.md!

πŸ”— Links & Resources

⭐ Show Your Support

If you find termi-host useful, please consider:

  • ⭐ Star this repository on GitHub
  • πŸ› Report bugs to help improve
  • πŸ’‘ Suggest features you'd like to see
  • πŸ“’ Share with others who might find it useful
  • 🀝 Contribute code or documentation

🌟 Acknowledgments


⚑ Built with ❀️ for developers who need terminal access anywhere

Releases

No releases published

Packages

 
 
 

Contributors