Termux Local Server

Python

Check If Python Is Installed

python --version
pkg install python

Start The Server

cd project → go to project folder before starting server

python -m http.server 8000
http://localhost:8000
You should see
Serving HTTP on 0.0.0.0 port 8000

Access From Another Device

ip addr
http://192.168.x.x:8000
ip addr
Check IP

Stop The Server

Ctrl + C

PHP

Check If PHP Is Installed

php -v
pkg install php

Start The Server

cd project → go to project folder before starting server

php -S localhost:8000
http://localhost:8000

Access From Another Device

ip addr
http://YOUR_IP:8000
ip addr
Check IP

Stop The Server

Ctrl + C