Modern, secure web-based terminal manager with multi-user support
A powerful enterprise-level terminal application that runs in your browser. Manage multiple terminal sessions, collaborate with team members, and monitor system activitiesโall from a beautiful, responsive web interface.
TriTerm brings the power of your terminal to the browser with enterprise features like user authentication, role-based access control, audit logging, and real-time collaboration. Perfect for:
- Remote server management - Access your servers from anywhere
- Team collaboration - Multiple users can manage terminals
- System monitoring - Admin dashboard with real-time stats
- Secure access - Authentication, RBAC, and audit trails
- Development teams - Share terminal sessions safely
- โ Multiple concurrent terminals (up to 10 per user)
- โ Side-by-side layouts with automatic arrangement
- โ Resizable terminal panes with drag handles
- โ Full terminal emulation powered by xterm.js
- โ Command history with local storage
- โ Copy/paste support with keyboard shortcuts
- โ User registration and login with JWT tokens
- โ OAuth support (GitHub, Google, GitLab ready)
- โ Role-based access control (Admin, User roles)
- โ Password hashing with bcrypt
- โ Session management with database persistence
- โ Audit logging for all authentication events
- โ CORS and rate limiting protection
- โ System overview with real-time statistics
- โ User management (create, update, delete, role assignment)
- โ Session monitoring - Track active terminal sessions
- โ Audit log viewer - Security event tracking
- โ System metrics - CPU, memory, uptime monitoring
- โ TypeScript - Full type safety
- โ Hot reload in development
- โ Docker support - One-command deployment
- โ CI/CD pipelines - GitHub Actions ready
- โ Automated testing - Unit, integration, and E2E tests
- โ Code formatting - ESLint + Prettier configured
- โ Monitoring stack - Prometheus + Grafana
- โ Health checks - Automated system monitoring
- โ Backup scripts - Database backup/restore
- โ Load balancing ready
- โ SSL/TLS support via reverse proxy
- โ Environment-based config for different deployments
| Operating System | Terminal | Status | Notes |
|---|---|---|---|
| Linux | bash, zsh, sh | โ Fully Supported | Recommended platform |
| macOS | bash, zsh | โ Fully Supported | All features working |
| Windows 10/11 | PowerShell, WSL | PowerShell works, WSL recommended | |
| Docker | Any | โ Fully Supported | Best for production |
| Component | Minimum Version | Recommended | Notes |
|---|---|---|---|
| Node.js | 18.x | 20.x LTS | Required for server |
| npm | 8.x | 10.x | Package manager |
| Database | SQLite | PostgreSQL | SQLite for dev, PostgreSQL for prod |
| Browser | Chrome 90+ | Latest Chrome/Firefox | Safari 14+ also supported |
| RAM | 512MB | 2GB+ | For running multiple terminals |
| Browser | Version | Status | Notes |
|---|---|---|---|
| Chrome/Edge | Latest 2 versions | โ Full Support | Recommended |
| Firefox | Latest 2 versions | โ Full Support | All features working |
| Safari | 14+ | โ Full Support | macOS/iOS |
| Mobile Safari | iOS 14+ | Touch interactions vary | |
| Android Chrome | Latest | Better on tablets |
For local development or cloned repositories:
# 1. Install dependencies first
npm install
# 2. Run interactive setup wizard
npx triterm setup
# 3. Start the server
npx triterm startThe setup wizard will:
- Create
.envconfiguration file - Set up the database with Prisma
- Generate Prisma client
- Run database migrations
After setup, the app will be available at:
- Frontend: http://localhost:5173 (or next available port)
- Backend: http://localhost:3000
CLI Commands:
npx triterm setup # Interactive setup wizard
npx triterm start # Start server (development mode)
npx triterm start -p 8080 # Start on custom port
npx triterm start --prod # Start in production mode
npx triterm start --auth # Require authentication
npx triterm migrate # Run database migrations
npx triterm migrate --reset # Reset database (WARNING: deletes data)
npx triterm build # Build client for production
npx triterm info # Display system information
npx triterm --help # Show all commandsOnce published to npm, you can try without cloning:
# This will work when package is published
npx triterm@latest setup
npx triterm@latest start# 1. Clone the repository
git clone https://github.com/yourusername/triterm.git
cd triterm
# 2. Install dependencies
npm install
# 3. Set up the database
cd server
npx prisma generate
npx prisma migrate deploy
cd ..
# 4. Start development servers
npm run devThe app will be available at:
- Frontend: http://localhost:5173
- Backend: http://localhost:3000
# Start all services with Docker Compose
docker-compose up -d
# Access the application
# http://localhost:3000The first user to register automatically becomes an admin. After starting the app:
- Navigate to http://localhost:5173
- Click "Register" and create your account
- You'll be automatically logged in with admin privileges
- Access the admin dashboard via the shield icon in the header
Create a .env file in the server/ directory:
# Server Configuration
PORT=3000
NODE_ENV=development
HOST=0.0.0.0
# Database (SQLite for development)
DATABASE_URL="file:./dev.db"
# For production with PostgreSQL:
# DATABASE_URL="postgresql://user:password@localhost:5432/triterm"
# Authentication
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
JWT_EXPIRES_IN=15m
JWT_REFRESH_EXPIRES_IN=7d
# Security (Optional - for restricted access)
REQUIRE_AUTH=false
AUTH_TOKEN= # Set this to enable token-based API access
# Limits
MAX_TERMINALS=10
RATE_LIMIT_MAX=100
RATE_LIMIT_WINDOW=60000
# OAuth (Optional)
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
# Frontend URL (for OAuth callbacks)
CLIENT_URL=http://localhost:5173Copy from the example:
cp server/.env.example server/.env
# Edit server/.env with your valuesDevelopment (SQLite):
cd server
npx prisma generate
npx prisma migrate dev --name initProduction (PostgreSQL):
# Update DATABASE_URL in .env to PostgreSQL connection string
cd server
npx prisma generate
npx prisma migrate deploy- Create an account or log in
- Create terminals using the "+" button
- Use multiple terminals side-by-side
- Resize terminals by dragging the separator
- Maximize/minimize terminals as needed
- Command history is saved automatically
Access the admin dashboard (shield icon) to:
- Monitor users - View all registered users
- Manage roles - Promote users to admin or demote to regular users
- Track sessions - See all active terminal sessions in real-time
- View audit logs - Security events and user actions
- System stats - Server health, memory usage, active users
triterm/
โโโ client/ # React frontend
โ โโโ src/
โ โ โโโ components/ # UI components
โ โ โ โโโ Auth/ # Login/Register
โ โ โ โโโ ui/ # shadcn/ui components
โ โ โ โโโ *.tsx # Terminal components
โ โ โโโ contexts/ # React contexts
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ lib/ # Utilities & API clients
โ โ โโโ pages/ # Admin dashboard pages
โ โ โโโ App.tsx # Main application
โ โโโ package.json
โ
โโโ server/ # Express + Socket.io backend
โ โโโ lib/ # Core libraries
โ โ โโโ auditLogger.ts
โ โ โโโ jwt.ts
โ โ โโโ password.ts
โ โ โโโ terminalSession.ts
โ โโโ middleware/ # Express middleware
โ โโโ routes/ # API routes
โ โ โโโ auth.ts # Authentication
โ โ โโโ admin.ts # Admin endpoints
โ โ โโโ terminals.ts # Terminal management
โ โโโ prisma/ # Database schema
โ โโโ index.ts # Server entry point
โ โโโ package.json
โ
โโโ monitoring/ # Prometheus + Grafana
โโโ scripts/ # Deployment & backup scripts
โโโ e2e/ # End-to-end tests
โโโ docker-compose.yml # Docker orchestration
โโโ package.json # Root package
# Production deployment
docker-compose -f docker-compose.prod.yml up -d
# With monitoring
docker-compose -f docker-compose.monitoring.yml up -d# 1. Build the client
npm run build
# 2. Set up database
cd server
npx prisma migrate deploy
# 3. Start the server
npm startserver {
listen 80;
server_name yourdomain.com;
# Redirect to HTTPS
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name yourdomain.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
# Proxy to TriTerm
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
# WebSocket support
location /socket.io/ {
proxy_pass http://localhost:3000/socket.io/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}-
Change JWT_SECRET - Use a strong random string
# Generate a secure secret openssl rand -base64 64 -
Use HTTPS - Always use SSL/TLS in production
-
Set strong passwords - Enforce password complexity
-
Configure CORS - Limit allowed origins
ALLOWED_ORIGINS=https://yourdomain.com
-
Enable rate limiting - Prevent abuse
RATE_LIMIT_MAX=50 RATE_LIMIT_WINDOW=60000
-
Use PostgreSQL - SQLite is for development only
-
Regular backups - Use provided backup scripts
./scripts/backup.sh
-
Keep dependencies updated
npm audit fix
# Run all tests
npm test
# Unit tests only
npm run test:unit
# E2E tests
npm run test:e2e
# Coverage report
npm run test:coverage
# Watch mode
npm run test:watchIssue: npx triterm setup fails with "Cannot find package 'commander'"
Solution:
For local development, you must install dependencies first:
npm install
npx triterm setupThis is only needed for local/cloned repositories. The published npm package would handle this automatically.
Issue: Server crashes with "does not provide an export named 'UserRole'" Solution:
The Prisma client needs to be generated:
cd server
npx prisma generate
cd ..
npx triterm startOr run the setup wizard which does this automatically:
npx triterm setupIssue: Cannot connect to server Solution:
- Ensure server is running on port 3000
- Check firewall settings
- Verify
CLIENT_URLin server.envmatches your frontend URL
Issue: Terminal not spawning Solution:
- Check shell path for your OS
- Verify node-pty installation:
npm rebuild node-pty - Check server logs for errors
Issue: Authentication not working Solution:
- Verify JWT_SECRET is set in
.env - Check database connection
- Clear browser localStorage and retry
Issue: Database errors Solution:
cd server
npx prisma generate
npx prisma migrate reset # WARNING: Deletes all data
npx prisma migrate deployIssue: Permission denied errors Solution:
# Make scripts executable
chmod +x scripts/*.shTriTerm includes a complete monitoring stack:
# Start with monitoring
docker-compose -f docker-compose.monitoring.yml up -d
# Access Grafana: http://localhost:3001
# Default login: admin/admin
# Access Prometheus: http://localhost:9090Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code style (ESLint + Prettier configured)
- Write tests for new features
- Update documentation as needed
- Use conventional commit messages
MIT License - see LICENSE file for details.
Built with these amazing technologies:
- xterm.js - Terminal emulation
- Socket.io - Real-time communication
- Prisma - Database ORM
- React - UI framework
- shadcn/ui - UI components
- Node-pty - Terminal process management
- Issues: Open an issue on GitHub
- Discussions: Use GitHub Discussions for questions
- Security: Report security issues privately
Made with โค๏ธ for the terminal enthusiast community