Get Termux from F-Droid (f-droid.org) or Github (github.com). Never install Termux from a third-party source! Play Store releases are depreciated and a security risk.
This tutorial covers home wifi network only. A more advanced setup is needed for switching between mobile and wifi data.
Termux Wiki (wiki.termux.com)
Open your wifi settings and get your IP. Keep it for later
Once Termux is installed open it up and get ready to run some commands
pkg update && pkg upgrade
If you don't want to use SSH skip steps 2 - 5
pkg install openssh
Get user name: whoami
- It will probably be something like
u0_a205
Set a password: passwd
- See here (wiki.termux.com) if you would rather Set up public key authentication
Start OpenSSH: sshd
Install Nginx: pkg install nginx
Start Nginx: nginx
Navigate to 127.0.0.1:8080
or localhost:8080
in your phones browser. On PC use your phones network address 192.168.1.XXX:8080
That's pretty much it. You now have a webserver and a webpage hosted on your phone.
nginx.conf is located at
/data/data/com.termux/files/usr/etc/nginx
index.html is located at
/data/data/com.termux/files/usr/share/nginx/html
Use nginx -s stop
to stop nginx
Get Termux from [F-Droid](https://f-droid.org/en/packages/com.termux) or [Github](https://github.com/termux/termux-app/releases). Never install Termux from a third-party source! Play Store releases are depreciated and a security risk.
This tutorial covers home wifi network only. A more advanced setup is needed for switching between mobile and wifi data.
[Termux Wiki](https://wiki.termux.com/wiki/Main_Page)
---
Open your wifi settings and get your IP. Keep it for later
Once Termux is installed open it up and get ready to run some commands
1. `pkg update && pkg upgrade`
2. If you don't want to use SSH skip steps 2 - 5
`pkg install openssh`
3. Get user name: `whoami`
- It will probably be something like `u0_a205`
4. Set a password: `passwd`
- See [here](https://wiki.termux.com/wiki/Remote_Access#Setting_up_public_key_authentication) if you would rather Set up public key authentication
5. Start OpenSSH: `sshd`
- Now you can connect to your phone via ssh from a remote source.
- default port is `8022`
6. Install Nginx: `pkg install nginx`
7. Start Nginx: `nginx`
8. Navigate to `127.0.0.1:8080` or `localhost:8080` in your phones browser. On PC use your phones network address `192.168.1.XXX:8080`
That's pretty much it. You now have a webserver and a webpage hosted on your phone.
nginx.conf is located at
`/data/data/com.termux/files/usr/etc/nginx`
index.html is located at
`/data/data/com.termux/files/usr/share/nginx/html`
Use `nginx -s stop` to stop nginx
(post is archived)