A real Linux terminal experience in your web browser. This project provides a web-based terminal that connects to a real Linux shell on the server.
- Real Linux terminal in the browser
- Full support for bash commands
- Persistent sessions
- Modern terminal UI with themes
- Responsive design
- Node.js (v14 or higher)
- npm (v6 or higher)
- Linux/macOS (for full functionality)
-
Clone this repository:
git clone https://github.com/yourusername/weblinux.git cd weblinux
-
Install dependencies:
npm install
-
Start the server:
npm start
-
Open your browser and navigate to:
http://localhost:3000
WebLinux uses:
- Frontend: HTML, CSS, JavaScript with the xterm.js library for terminal emulation
- Backend: Node.js with Express for serving static files
- Communication: WebSockets for real-time bidirectional communication
- Terminal: node-pty to spawn real terminal processes on the server
The web interface connects to a real bash shell running on the server, allowing you to execute actual Linux commands.
- Make sure Docker and Docker Compose are installed
- Run the application:
./run.sh
- Open your browser and navigate to
http://localhost:3000
This project can be deployed to Netlify with limited functionality:
-
Fork this repository to your GitHub account
-
Sign up for a Netlify account if you don't have one
-
Connect your GitHub repository to Netlify:
- Log in to Netlify
- Click "New site from Git"
- Choose GitHub and select your repository
- Configure build settings:
- Build command:
npm run build
- Publish directory:
public
- Build command:
- Click "Deploy site"
-
Set up environment variables in Netlify:
- Go to Site settings > Build & deploy > Environment
- Add the following variables:
NODE_VERSION
:16
-
For GitHub Actions deployment:
- Add these secrets to your GitHub repository:
NETLIFY_AUTH_TOKEN
: Your Netlify personal access tokenNETLIFY_SITE_ID
: Your Netlify site ID
- Add these secrets to your GitHub repository:
Note: The Netlify version has limited functionality due to serverless constraints. For the full experience, run the project locally or on a server with WebSocket support.
You can modify the shell used in server.js
:
const shell = 'zsh'; // Change to your preferred shell
This project gives terminal access to the server. In production:
- Implement proper authentication
- Set up user isolation
- Restrict command execution
- Consider using Docker containers for isolation
MIT