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

  1. From the App Store, download ISH
  2. Inside the app, download Python3, we will use it to run a server instead of nginx. Type this and enter.
apk add python3
  1. Start a server with python by typing the following command:
python3 -m http.server
  1. Visit server in your browser by typing http://0.0.0.0:8000
  2. Use ^+Z to kill the server.

Making an html page

  1. Create an HTML page inside the Terminal interface (ISh)
touch index.html
  1. Visit it or replace it by accessing it via the Files app.
  2. 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/