I need to access to my localhost from the Internet. I used to map my localhost to a port on my router and then to port forward it. But since I don't have the privileges to access my router, or at least I have to contact my ISP and that will take a lot of time. Is there any other way to expose my localhost to the Internet? Maybe a VPN could help.

There is a web page on my localhost which I would like to access.


This isn't the answer you're looking for, but I recommend that you not use a router given to you by your ISP. Your router is also your firewall, and do you want your ISP controlling the software and settings on your firewall?

The answer you're looking for is that yes, a VPN could help. You could set up an OpenVPN server on AWS or google, do the port-forwarding there, and use the AWS OpenVPN server's IP address for external access. However, that begs the question: Why not just put that webserver on AWS? Maybe there is a reason (e.g., if the webserver is your NextCloud home cloud server).

Also, if your router is configured for UPnP, you may be able to use that to automatically forward ports. You might have to install an mDNS server on your webserver machine (e.g., bonjour, zeroconf, rendezvous) to announce the webserver to the UPnP service on your router.

Honestly, I'd contact the ISP, I'd get a modem supported by the ISP, buy my own router, and configure it for port-forwarding. Short of that, I'd call the ISP to give me access to the firewall rules and add port forwarding.

  • Thank you! I will try with the VPN first. Is there any free VPN service? – dmak2709 Feb 9 at 17:33
  • I'm sure there are, but you need to forward connections on a reserved port of the VPN's public address to the private address of your web server (probably in the range). It is unlikely that you can do that without your own VPN server. That's why I suggested AWS and your own openvpn instance. – Rich Feb 9 at 18:19
  • Maybe a tutorial on how to do that? – dmak2709 Feb 9 at 18:36
  • Getting your ISP to cooperate oas easier. There are tutorials all over the web though. Search for openvpn awa tutorial and then also search for iptables port forwarding. – Rich Feb 9 at 18:38
  • d2930476l2fsmh.cloudfront.net/OpenVPNwithVPC.zip Make sure you use your own certificates and keys, though. – Rich Feb 9 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.