Control your Android device from any platform (Windows, Mac, Linux, or any device with a browser) without root access...
A persistent web server setup script for Termux on Android. No root required.
This script automates the installation and configuration of a persistent Apache web server on Android devices using Termux. It includes watchdog services, auto-start capabilities, and monitoring tools to ensure 24/7 operation.
- Persistent Operation - Watchdog service ensures server runs 24/7
- Auto-Start - Boot scripts and Termux-services integration
- Complete LAMP Stack - Apache, PHP 8.3, MariaDB
- Remote Management - SSH access and service control commands
- Monitoring - Resource usage tracking and logs
- Security - Password-protected admin access
- No Root Required - Runs entirely in Termux environment
- Install Termux from F-Droid or GitHub
- Run the setup script:
curl -sSL https://raw.githubusercontent.com/SleepTheGod/WebDroid/main/main.sh | bashOr clone and run manually:
git clone https://github.com/SleepTheGod/WebDroid
cd WebDroid
chmod +x main.sh
./main.sh- Apache - Web server with PHP support
- PHP 8.3 - Latest PHP version
- MariaDB - Database server
- Termux-services - Service management
- Watchdog - Auto-restart on crash
- Boot scripts - Start on device boot
- Monitoring tools - htop, nload, etc.
After installation, manage your server with:
# Start the server service
webserver-service start
# Check status
webserver-service status
# View logs
webserver-service logs
# Stop the server
webserver-service stop
# Restart
webserver-service restart- Local URL:
http://localhost:8080 - Network URL:
http://<device-ip>:8080 - Web root:
~/webserver/html/ - Admin credentials: Saved in
~/webserver/password.enc
~/webserver/
โโโ html/ # Web files (document root)
โโโ logs/ # Access and error logs
โโโ backup/ # Automated backups
โโโ ssl/ # SSL certificates
โโโ cgi-bin/ # CGI scripts
โโโ status/ # Server status pages
Edit the SERVER_PORT variable in the script before running.
Set before running:
export PASSWORD="your-secure-password"The script installs boot scripts automatically. For Termux:Boot app support, scripts are placed in ~/.termux/boot/.
- Watchdog logs:
~/webserver/logs/watchdog.log - Access logs:
~/webserver/logs/access_log - Error logs:
~/webserver/logs/error_log - Boot logs:
~/webserver/logs/boot.log
- Admin password is generated randomly and saved encrypted
- Basic authentication is configured via
.htpasswd - Consider changing passwords regularly
- Use SSL for production (certificates can be placed in
ssl/)
- Android 7.0+
- Termux app installed
- ~500MB free storage
- Internet connection for package download
# Check if port is already in use
netstat -tlnp | grep 8080
# View error logs
tail -f ~/webserver/logs/error_log# Check IP address
ip addr show
# Verify Apache is listening on all interfaces
grep Listen $PREFIX/etc/apache2/httpd.conf# Run storage permission setup
termux-setup-storageMIT License - see LICENSE file
Taylor Christian Newsome (ClumsyLulz)
- Email: SleepRaps@gmail.com
- GitHub: @SleepTheGod
- Termux community
- Apache Software Foundation
- PHP Development Team
Made with โค๏ธ for the Termux community
# WebDroid v3.0 - Cross-Platform Android Remote Control
Control your Android device from any platform (Windows, Mac, Linux, or any device with a browser) without root access. Transform your Android device into a 24/7 accessible web server with remote control capabilities.
[](https://github.com/SleepTheGod/WebDroid)
[](https://termux.com)
[](LICENSE)
## ๐ Overview
WebDroid turns your Android device into a powerful, persistent web server with remote control capabilities. Access and control your device from anywhere on your network using a web browser, REST API, or WebSocket connections.
### โจ Key Features
- **๐ Cross-Platform Control** - Access from Windows, Mac, Linux, or any device with a browser
- **๐ 24/7 Operation** - Watchdog service ensures server never stops
- **๐ฑ Remote File Manager** - Upload, download, and edit files
- **๐ป Web Terminal** - Execute commands remotely
- **๐ REST API** - Programmatic access for automation
- **๐ Real-time Monitoring** - Live system metrics and logs
- **๐ Auto-Recovery** - Self-healing on crashes
- **๐ Secure Access** - JWT authentication and HTTPS ready
- **โก No Root Required** - Runs entirely in Termux
- **๐ฆ Multiple Clients** - Python, Node.js, and shell scripts included
## ๐ Quick Start
1. **Install Termux** from [F-Droid](https://f-droid.org/packages/com.termux/) or [GitHub](https://github.com/termux/termux-app/releases)
2. **Run the installation script**:
```bash
curl -sSL https://raw.githubusercontent.com/SleepTheGod/WebDroid/main/main.sh | bashOr clone and run manually:
git clone https://github.com/SleepTheGod/WebDroid
cd WebDroid
chmod +x main.sh
./main.sh-
Follow the prompts:
- Choose your web port (default: 8080)
- Set admin password (or let it generate randomly)
- Wait for installation to complete
-
Connect from any device:
- Note the IP address shown after installation
- Open
http://[device-ip]:8080/remote.htmlin any browser - Login with your admin credentials
- Apache Web Server - Host websites and applications
- Node.js API Server - REST API on port 8081
- WebSocket Server - Real-time updates on port 8082
- Watchdog Service - Auto-restart on crashes
- Keep-Alive Service - Prevents device sleep
- Boot Scripts - Auto-start on device boot
- Web Interface - Full control from any browser
- File Manager - Browse, edit, upload/download files
- Terminal Access - Execute commands remotely
- System Monitor - Real-time CPU, memory, disk usage
- Log Viewer - Access all server logs
- Service Control - Start/stop/restart services
connect.bat- Windows batch fileconnect.sh- Linux/Mac shell scriptwebdroid_client.py- Python client with full APIwebdroid.js- Node.js interactive shellREADME.md- Client documentation
# Check server status
webserver status
# Open remote control interface
webserver remote
# View all logs
webserver logs
# Control API server
webserver api status
webserver api restart
webserver api logs
# Show client connection info
webserver client
# Recover from crashes
webserver recover
# Battery optimization help
webserver battery
# Get server information
webserver info- Open
http://[android-ip]:8080/remote.html - Login with admin credentials
- Use the dashboard to:
- Monitor system status
- Control services
- Browse files
- Execute commands
- View logs
from webdroid_client import WebDroidClient
client = WebDroidClient('192.168.1.100')
client.authenticate('your-password')
# Check status
status = client.get_status()
# List files
files = client.list_files('/html')
# Execute command
result = client.execute_command('uptime')cd ~/webserver/client
node webdroid.js interactive# Get authentication token
curl -X POST http://192.168.1.100:8081/api/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"your-password"}'
# Check status (with token)
curl -H "Authorization: Bearer YOUR_TOKEN" \
http://192.168.1.100:8081/api/status
# Start server
curl -X POST -H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"service":"webserver"}' \
http://192.168.1.100:8081/api/service/start~/webserver/
โโโ html/ # Web files (document root)
โ โโโ remote.html # Remote control interface
โ โโโ status.php # Status dashboard
โ โโโ api-docs.html # API documentation
โ โโโ edit.html # File editor
โโโ logs/ # All log files
โ โโโ access_log
โ โโโ error_log
โ โโโ api.log
โ โโโ watchdog.log
โโโ client/ # Client scripts
โ โโโ connect.bat
โ โโโ connect.sh
โ โโโ webdroid_client.py
โ โโโ webdroid.js
โโโ api/ # API servers
โ โโโ flask_api.py
โโโ backup/ # Automated backups
โโโ ssl/ # SSL certificates
โโโ .htpasswd # Authentication file
# In ~/webserver/.env
JWT_SECRET=your-secret-key
ADMIN_USER=admin
ADMIN_PASS_HASH=hashed-passwordEdit the script variables before installation:
SERVER_PORT=8080 # Web server port
API_PORT=8081 # API server port
WEBSOCKET_PORT=8082 # WebSocket port- Place certificates in
~/webserver/ssl/ - Update Apache config to use SSL
Access real-time monitoring:
- Web Interface:
http://[ip]:8080/status.php - API:
http://[ip]:8081/api/status - WebSocket:
ws://[ip]:8082
- JWT authentication for API
- Password-protected web interface
- Encrypted password storage
.htpasswdfor basic auth- API key option for Python client
- Configurable CORS settings
- Android: 7.0 or higher
- Termux: Latest version from F-Droid
- Storage: ~1GB free space
- Network: Wi-Fi (both devices on same network)
- Battery: Disable optimization for Termux
# Check IP address
ip addr show
# Verify services are running
webserver status
# Check firewall (Android typically has none)# Run recovery
webserver recover
# Check logs
webserver logs error# Restart API
webserver api restart
webserver api logs# Get optimization help
webserver battery# Check if server is listening
netstat -tln | grep 8080
# Restart all services
webserver restartContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
MIT License - see LICENSE file
Taylor Christian Newsome (ClumsyLulz)
- Email: SleepRaps@gmail.com
- GitHub: @SleepTheGod
- Termux team for the amazing terminal emulator
- Node.js and Python communities
- Apache Software Foundation
- All contributors and users
# Installation
curl -sSL https://raw.githubusercontent.com/SleepTheGod/WebDroid/main/main.sh | bash
# Management
webserver remote # Open remote control
webserver status # Check all services
webserver logs # View logs
webserver recover # Fix crashes
webserver client # Show client info
# Access URLs (replace IP with your device IP)
http://192.168.1.100:8080/remote.html # Remote control
http://192.168.1.100:8080/status.php # Monitoring
http://192.168.1.100:8081 # API endpoint
ws://192.168.1.100:8082 # WebSocketMade with โค๏ธ for the open-source community
Control your Android device from anywhere, on any platform!
