I use to develop my project on my localhost, on apache in ubuntu machine. Sometimes i need to show progress to my costumer. Is it possible to access to localhost from remote machine?
-
2The naming in this question is a bit ambiguous: `localhost` is the de-facto standard (DNS) name for the local loop back address `127.0.0.1`, which *can not* be accessed from outside of the (local) host itself. – alk Jul 06 '12 at 16:10
-
Possible duplicate of [How do I connect to this localhost from another computer on the same network?](https://stackoverflow.com/questions/9682262/how-do-i-connect-to-this-localhost-from-another-computer-on-the-same-network) – KyleMit Jan 20 '19 at 03:57
4 Answers
You can use a service that provides a tunnel to your local service, such as localtunnel, pagekite or ngrok. These services simplify setting up remote demos, mobile testing and some provide request inspection as well.
I find ngrok useful because it provides a https address, which is needed to test things like webcam access.

- 5,496
- 37
- 56
-
1Thank you, even though this is an oldish comment, it really helped me. I was having trouble with a website I made, but ngrok was what I needed. – Oct 30 '20 at 20:17
Terms used in this answer:
- Host = machine with site on it
- Client = machine you are trying to access the host from
If the host and client are on the same network, you can access the host from the client by entering
http://(hostname or ip address)
in your client's browser. If the site is not running on port 80 (for http) or port 443 (for https), add the post as so (this example is for if your server is on 8080, a common alternate port):
http://(hostname or ip address):8080
If the host and client are not on the same network, and you need to reach across the internet from the client to see the host, you will need to make your host available on the internet for the client to access.
This can be extremely dangerous for your information security if you're not sure what you're doing and I'd recommend getting a cheap-o hosting account (can get them for like $10/month at places like 1:1 hosting).

- 308
- 1
- 12
There are many methods to do this - the difference is security, easiness of the configuration and cost of the solution.
Following I am typing some methods with some analyses
- Port Forwarding (with Dynamic DNS and SSL encryption)
This requires router configuration (to forward your routers public port to loclhoat port), however this requires you to have fixed ip address. In case your ip address is not fixed (in most cases) you need to use Dynamic DNS services to be able to use domain name instead ip address (there are lot of available free services). Here we still have security question open. To solve security question i.e. setup ssl certificate we can use Let’s Encrypt service ( https://letsencrypt.org/ ) to get free certificate, however we should configure local server to use the certificate or we should setup reverse proxy (in most cases nginx or apache) and configure proxy to use certificate.
Conclusion – Hard to setup if we want to have secure connection (can be done for free)
- VPN
For this scenario we should use VPN services. We should connect our local machine to VPN then in other side we should connect our client's machine to VPN that will allow us to access to localhost by local IP address. We can set up our own VPN server however this requires knowledge to do it right.
Conclusion – Easy, Paid, Secure, Bad User Experience (connecting to VPN every time you need to connect to localhost)
- Tunneling
For this scenario we can use free tunneling services (i.e. https://tunnelin.com/). The process is very straight forward i.e. Register a User, Connect your device to service (by running one line command on device), use Web interface to open/close secure tunnels to the device.
Conclusion – Free, Secure, Easy

- 1,405
- 1
- 15
- 24
-
I like multiple options but why *should* we use VPN. While this indicates that you favor this option, I miss an explanation why. – Natan Sep 07 '22 at 11:58
Yes, if you have a public and static IP. Usually, ISPs offer static ips during a session (i.e. until you disconnect and connect again)

- 9,925
- 6
- 38
- 51
-
So what have to write in the second machine browser to see website of localhost of first computer? – Salvatore Dibenedetto Jul 06 '12 at 14:54
-
Supposing you meet the 2 above requirement, you have to write this: http://ip_of_your_machine:port/path_to_resource(website) – Razvan Jul 06 '12 at 15:02
-
Ah it's working! i've launched ifconfig from console, checked ip and pasted it into browser of second computer! i can see all my project from remote pc! – Salvatore Dibenedetto Jul 06 '12 at 15:02
-