How to setup a website using Termux?

Hey Guys,

This is Zaeem, Today we gonna see how to set up a static website on Termux, If You have Knowledge of PHP, HTML, CSS, and JS you can easily make your website but are worried about Hosting and you are here for something like FREE, So without wasting time Let's Begin...


how to setup a website using Termux


Here I am Assuming That you had made a simple website whose files are:

• index.html

• style.css


Things you need:

• Termux (Download it from Google Play Store)

• Ngrok Account 

• Apache webserver (This we will setup inside of termux)


Termux Setup:

👉 apt update && apt upgrade

👉 apt install zip wget -y

👉 apt install php -y

👉 apt install apache2

Apache Setup:

👉 rm /usr/share/apache2/default-site/htdocs/index.html  (it will remove default HTML page)

👉 cd

👉 cd /sdcard/yourwebsitefolder/

👉 ls 

👉 mv index.html style.css /usr/share/apache2/default-site/htdocs/

👉 apachectl 


Note:- if you have a php website then you have to use a PHP server

Now type a http://localhost:8080/index.html

Your website will appear but it is in your local network, Now we will configure to over a WAN

Ngrok Setup:

👉 cd

👉 wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip

👉 unzip ngrok-stable-linux-arm.zip

👉 chmod +x ngrok

👉 ./ngrok authtoken YOUR_TOKEN

👉 ./ngrok http 8080

you will get a random domain that is accessible over WAN, if you want to change it you have to connect your custom domain...

Advantage of Setting Up Website in Termux:

• Reliable easy to access all files 

• No need To Purchase any hosting

Disadvantage of Setting up Website in Termux:


You have to make Termux to be run in the background 

• If your device will turn off your website will be Down


Thanks for visiting My Website...

Post a Comment

0 Comments