Sign inSign up

kzamanbd/terminal

By kzamanbd

Updated 12 months ago

A web-based SSH terminal that enables secure connections to remote servers through your browser.

Image
Developer tools
0

1.6K

kzamanbd/terminal repository overview

🌐 Browser Terminal - Web-based SSH Client

A modern, full-stack web-based SSH terminal client that enables secure connections to remote servers through your browser. Built with React, NestJS, Socket.IO, and xterm.js for a seamless terminal experience.

🚀 Quick Start

# Run the complete application with a single command
docker run -p 8080:80 -p 8081:8081 kzamanbd/terminal:latest
  • Web Interface: http://localhost:8080
  • API Server: http://localhost:8081
  • Health Check: http://localhost:8080/health

✨ Key Features

  • 🔐 Secure SSH Connections: Connect to remote servers through your browser
  • ⚡ Real-time Terminal: Socket.IO powered terminal interface with instant output
  • 🎨 Theme Support: Multiple terminal themes with xterm.js addons
  • 🔑 Multiple Auth Methods: Username/password and SSH key authentication
  • 📱 Responsive Design: Works perfectly on desktop and mobile devices
  • 🐳 Single Container: Complete application in one optimized Docker image
  • 🔄 Health Monitoring: Built-in health check endpoints
  • ⚙️ Production Ready: Nginx reverse proxy with proper process management

🏗️ Architecture

Full-Stack Monorepo:

  • Frontend: React 18 + TypeScript + Vite + Tailwind CSS + xterm.js
  • Backend: NestJS + Socket.IO + ssh2 + Node.js 22+
  • Infrastructure: Single Docker image with Nginx reverse proxy
  • DevOps: Multi-stage Docker build, pnpm workspace, Turborepo

🛠️ Tech Stack

ComponentTechnology
FrontendReact 18, TypeScript, Vite, Tailwind CSS, xterm.js
BackendNestJS, Socket.IO, ssh2, Node.js 22+
InfrastructureDocker, Nginx, tini, Alpine Linux
Build Toolspnpm, Turborepo, Multi-stage Docker

🚀 Production Deployment

version: '3.8'
services:
  browser-terminal:
    image: kzamanbd/terminal:latest
    container_name: browser-terminal
    restart: unless-stopped
    ports:
      - "80:80"      # Web interface
      - "8081:8081"  # API server
    environment:
      - NODE_ENV=production
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:80/health"]
      interval: 30s
      timeout: 10s
      retries: 3
Kubernetes Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: browser-terminal
spec:
  replicas: 2
  selector:
    matchLabels:
      app: browser-terminal
  template:
    metadata:
      labels:
        app: browser-terminal
    spec:
      containers:
      - name: browser-terminal
        image: kzamanbd/terminal:latest
        ports:
        - containerPort: 80
        - containerPort: 8081
        livenessProbe:
          httpGet:
            path: /health
            port: 80
          initialDelaySeconds: 30
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /health
            port: 80
          initialDelaySeconds: 5
          periodSeconds: 5

📋 Usage

  1. Connect to SSH Server

    • Enter server details (host, port, username)
    • Provide authentication (password or SSH key)
    • Click connect to start terminal session
  2. Use the Terminal

    • Execute commands as in a regular terminal
    • Switch themes and customize experience
    • Real-time output with Socket.IO

🔧 Configuration

Environment Variables
VariableDescriptionDefault
NODE_ENVEnvironment modeproduction
PORTAPI server port8081
Health Checks
  • Web Interface: GET /health - Returns "healthy"
  • API Server: GET /health - Returns {"status":"ok"}

🐳 Docker Image Details

  • Base Image: Node.js 22 Alpine Linux
  • Size: Optimized multi-stage build
  • Process Management: tini for proper signal handling
  • Web Server: Nginx reverse proxy
  • Ports: 80 (web), 8081 (API)
  • Health Checks: Built-in monitoring endpoints

🔍 Monitoring

# Check container health
docker ps
docker logs browser-terminal

# Check API health
curl http://localhost:8081/health

# Check web interface health
curl http://localhost/health

🚨 Troubleshooting

Common Issues
  1. Port Conflicts

    # Use different ports
    docker run -p 8080:80 -p 8081:8081 kzamanbd/terminal:latest
    
  2. Container Won't Start

    # Check logs
    docker logs browser-terminal
    
  3. API Not Responding

    # Test API directly
    curl http://localhost:8081/health
    

📝 License

MIT License - see LICENSE for details.

👨‍💻 Author

Kamruzzaman - Full-stack developer specializing in modern web applications


Ready to deploy? Just run docker run -p 8080:80 -p 8081:8081 kzamanbd/terminal:latest and start connecting to your remote servers through your browser! 🚀

Tag summary

Content type

Image

Digest

sha256:751434a77

Size

58.8 MB

Last updated

12 months ago

docker pull kzamanbd/terminal