For iPhone users, Termux isn’t available. However there exist an alternative but with limited features.
ISH
ISH is a linux-like Command Line Interface (CLI) app, that emulates some experience of using the Terminal on iPhone.
Installation & Server
- From the App Store, download ISH
- Inside the app, download Python3, we will use it to run a server instead of nginx. Type this and enter.
apk add python3
- Start a server with python by typing the following command:
python3 -m http.server
- Visit server in your browser by typing http://0.0.0.0:8000
- Use
^+Zto kill the server.
Making an html page
- Create an HTML page inside the Terminal interface (ISh)
touch index.html
- Visit it or replace it by accessing it via the Files app.
- Go to Files, type isH, and locate the Root folder: this is what is served by your phone server.
Resources
This tutorial explains it well: https://beebom.com/run-simple-web-server-iphone/