A modern, secure web-based Linux terminal simulator designed for safe learning and experimentation. Students can practice Linux commands in isolated Docker containers without affecting the host system or other users.
Maximum Freedom + Perfect Isolation - Users can execute almost any command, even destructive ones, within their own isolated sandbox environment. Each session runs in a separate Docker container that's destroyed after use.
- Docker Container Isolation: Each user session runs in a separate, isolated container
- Temporary Workspaces: Fresh filesystem for each session, automatically destroyed
- Resource Limits: CPU, memory, and disk usage controls
- Multi-User Safe: Users cannot see or affect each other's sessions
- Host Protection: Complete isolation from the host system
- Real Linux Commands: Execute actual bash commands and programs
- Full Command Support: Programming languages, text editors, system tools
- ANSI Color Support: Proper terminal colors and formatting
- Command History: Arrow key navigation through previous commands
- Text Selection: Copy terminal output with mouse selection
- Keyboard Shortcuts: Standard terminal shortcuts (Ctrl+C, Ctrl+L, etc.)
- Comprehensive File Structure: Realistic Linux directory layout
- Sample Files: Pre-configured examples and tutorials
- Programming Ready: Python, shell scripts, and development tools
- Educational Content: Built-in tutorials and command examples
- Django 5.2.5 - Web framework
- Django Rest Framework 3.16.1 - REST API framework
- Django Channels - WebSocket support for real-time terminal
- Python 3.11 - Runtime environment
- Docker - Containerization and isolation
- PTY - Pseudo-terminal for authentic shell experience
- React 19.1.1 - Modern UI framework with hooks
- Vite - Fast build tool and development server
- Tailwind CSS 4 - Utility-first styling
- WebSocket - Real-time communication
- Heroicons - Beautiful SVG icons
- Docker and Docker Compose
- Git
- Node.js
git clone https://github.com/santoshvandari/LearnLinux.git
cd LearnLinux
cd backend
docker-compose up --build
The backend will be available at http://localhost:8000
or http://127.0.0.1:8000
cd frontend
npm install
npm run dev
The frontend will be available at http://localhost:5173
or http://127.0.0.1:5173
cd backend
# Build the image
docker build -t learn-linux .
# Run with Docker Compose (recommended)
docker-compose up -d
# Or run directly
docker run -d \
-p 8000:8000 \
--name learn-linux \
--security-opt no-new-privileges:true \
--cap-drop ALL \
--cap-add SETUID --cap-add SETGID --cap-add SYS_ADMIN \
learn-linux
cd frontend
npm run build
# Serve the dist/ folder with your web server
- User connects → Frontend generates unique session ID
- WebSocket established → Real-time communication channel created
- Container spawned → Isolated Docker environment with temporary workspace
- Commands executed → PTY forwards commands to shell in container
- Session ends → Container destroyed, all data cleaned up
User Input → Frontend Validation → WebSocket → Django Consumer
↓
Docker Container (Isolated) → Shell Process → Command Execution
↓
Output → PTY → WebSocket → Frontend Display
LearnLinux/
├── backend/ # Django backend
│ ├── core/ # Django settings and configuration
│ ├── terminal/ # WebSocket consumer and terminal logic
│ ├── Dockerfile # Container configuration
│ ├── docker-compose.yml # Service orchestration
│ └── requirements.txt # Python dependencies
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── utils/ # Utility functions
│ │ └── styles/ # CSS styling
│ ├── package.json # Node.js dependencies
│ └── vite.config.js # Vite configuration
└── README.md # This file
# Backend (.env)
DJANGO_DEVELOPMENT=False # Set to True for development
ALLOWED_HOSTS=localhost,127.0.0.1,your-domain.com
# Frontend (.env)
VITE_BACKEND_URL=http://localhost:8000
VITE_WS_URL=ws://localhost:8000
- Container Limits: 1GB RAM, 1 hour timeout, 50 processes max
- Network: Isolated container networking
- Filesystem: Temporary workspaces with automatic cleanup
- Commands: Flexible filtering with education-friendly permissions
- Linux Command Learning: Safe environment for beginners
- System Administration Practice: Try dangerous commands safely
- DevOps Learning: Practice containerization and deployment
# File system exploration
ls -la
cd Documents/
cat welcome.txt
# System monitoring
ps aux
top
free -m
df -h
# Text processing
grep "Linux" *.txt
awk '{print $1}' sample.log
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Commit changes:
git commit -am 'Add feature'
- Push to branch:
git push origin feature-name
- Submit a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with modern web technologies for optimal learning experience
- Inspired by the need for safe Linux command practice environments
- Designed with security and education as top priorities