1

I want to make my phone a Linux web server, by using the userLand application which gives you the ability to use ubuntu distribution on Andriod.

I already installed Django and ran my server on port 8080 since port 80 is busy (seems logical that android is using it)

and everything is good, it works when I try to access the website from another device on the local network.

so I proceeded to the next step which is making the website accessible from all over the internet then I found that you need to make a port forwarding on the router to allow devices from outside the local network to access a device in the localnetwork .

I followed the following steps :

  1. made the phone's IP static locally
  2. added the configuration needed for the port forwarding (phone's ip, port 8080, etc... )
  3. found the public IP for my phone and used it and with port 8080

it is still not working: I can access the website locally but can't access it through the internet.

I tried another method by using an already working server from the "AWebServer" application on google play

but still the same problem.

I tried temporarily to disable the firewall on the router but still the same problem

and finally, I tried to open the port on my laptop with OS: Windows 10 instead of the phone OS: Android, and checked with port checker but the port is closed and still the same problem.

I have been trying to solve this for a whole day)), I would be very happy if someone helped me.

thanks

first image

second image

  • Do you have a static ip from your ISP? If not some ISPs will put you under a NAT and hence this method of port forwarding would not work. What you can however try is with a service such as ngrok where you will get a tunneled url to access your application from public internet. – Arun T Feb 02 '22 at 10:48
  • no I don't have one . maybe this is really the actual problem , Thanks a lot bro I will try ngrok – عبدالرحمن ايمن Feb 02 '22 at 11:07
  • I have been trying the same thing for last few days on my raspberry pi. So I read a lot about this. Can I add this as an answer so that you can accept it? It would help someone else searching for the same. – Arun T Feb 02 '22 at 11:09
  • Ngrok works for me but it gives a variant port number and variant domain name(the first number of the domain ) every time you reopen Ngrok, But here is the good news: you can use Ngrok with a subscription and they will give you a domain name. so your answer is helped me a lot but please add the point of subscription, and I will directly make it as an answer. I am really thankful. – عبدالرحمن ايمن Feb 03 '22 at 09:29
  • I have added the point in the answer. Thankyou. – Arun T Feb 03 '22 at 18:06
  • I appreciate Your Answer brother , – عبدالرحمن ايمن Feb 04 '22 at 09:33

1 Answers1

0

Your ISP might have put you under a NAT, in that case port forwarding might still not work.

Your best bet is to use some sort of SSH Tunnels.

You can try with ngrok.

This will give you a URL to access your application from public internet.

Only caveat here is that ngrok is not free. They have a subscription based model. In the free tier, you can use ngrok but the link url changes after few hours.

If you want to, you can also implement something like ngrok for yourself. Read about ssh tunneling more. This will help you.

Arun T
  • 1,114
  • 6
  • 17