Turn your Android Phone into a Personal Web Hosting Server using Termux + PHP + Cloudflare Tunnel.
✅ PHP Web Server
✅ Cloudflare Tunnel Support
✅ Custom Domain Support
✅ HTTPS SSL Free
✅ Works on WiFi & Mobile Data
✅ File Manager Access
✅ One Command Start System
✅ Website Hosting From Android
✅ Easy Backup & Transfer
- Android Phone
- Termux App
- Internet Connection
- Cloudflare Account (For Custom Domain)
Download Termux:
https://f-droid.org/packages/com.termux/
Update Termux:
pkg update -y
pkg upgrade -yInstall Packages:
pkg install php git wget nano curl -yClone Repository:
git clone https://github.com/tzalmamun/mobile-hosting-server.gitEnter Folder:
cd mobile-hosting-serverRun Installer:
bash install.shInstaller will setup:
- PHP Server
- Cloudflare Tunnel
- Sky Command
- Website Folder
- File Manager
Your website files will be stored here:
~/public_html
Example:
public_html
│
├── index.php
├── style.css
├── images
└── other files
After installation just type:
skyIt will automatically start:
PHP Server
+
Cloudflare Tunnel
+
Public Website Link
Stop manually:
sky-stopor:
pkill php
pkill cloudflaredLogin:
cloudflared tunnel loginCreate Tunnel:
cloudflared tunnel create skyhostrCheck Tunnel ID:
cloudflared tunnel listConnect Domain:
Example:
cloudflared tunnel route dns skyhostr www.example.comCreate config:
nano ~/.cloudflared/config.ymlAdd:
tunnel: YOUR-TUNNEL-ID
credentials-file: /data/data/com.termux/files/home/.cloudflared/YOUR-TUNNEL-ID.json
ingress:
- hostname: www.example.com
service: http://127.0.0.1:8080
- service: http_status:404Save file.
Upload:
tinyfilemanager.php
into:
~/public_html
Open:
https://yourdomain.com/tinyfilemanager.php
You can:
✅ Edit Files
✅ Upload Files
✅ Delete Files
✅ Manage Website
Open:
nano ~/public_html/index.phpEdit your text.
Save:
CTRL + O
ENTER
CTRL + X
Refresh website.
Install Termux on new phone.
Run:
pkg update -y
pkg install git php wget nano -y
git clone https://github.com/tzalmamun/mobile-hosting-server.git
cd mobile-hosting-server
bash install.shThen:
skyYour server will start again.
Run:
pkill phpThen:
skyRestart:
pkill cloudflared
sky| Command | Function |
|---|---|
| sky | Start Server |
| sky-stop | Stop Server |
| pkill php | Stop PHP |
| pkill cloudflared | Stop Tunnel |
Created for Mobile Hosting Server Project
GitHub: