Expose your local 💻 web server to the world 🌐
Tags: webdev, tutorial, productivity, testing
Published: 2020-01-17 09:30:35

---
title: Expose your local 💻 web server to the world 🌐
published: true
description: How to expose locally developed web app using localhost.run or serveo.net so they can be accessed over the internet 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/puffll9la7x4mkw7tqmm.png
tags: webdev, tutorial, productivity, testing
---

## Why ?
Web developers (mostly) develop on localhost using our preferred tools and languages and have a local server to test what we build.  At times we might need to show a coleague or a client our progress or even test using online test tools such as browserstack. 

It might be not worth the effort to deploy on a dev server to test a small change that we made or the process of deploying might be time consuming or might not have time to wait for deployment to finish.

Whatever the reason, **no stress** there is very easy way to expose our localhost using services such as  [localhost.run](localhost.run), [serveo.net](serveo.net), [ngrok.com](ngrok.com), [no-ip.com](no-ip.com) and there is probably others.

Perhaps the most well known are ngrok and no-ip.com but last time I checked you had to register to use them and hence I looked for easier ways and discovered the alternatives which I will present below.

For tutorials on how to use ngrok.com and/or no-ip.com I am sure you can find plenty on dev.to or just with a quick search.

## How ?

**Localhost.run** can be used without registering you just need to call a simple command on your terminal 

```
ssh -R 80:localhost:8080 ssh.localhost.run
```

Where 8080 is assumed to be the listening port of your local server.

Here is a simple example.  Suppose you have your local development server running on port 3000 so you are testing things out by visting `localhost:3000`.  

On your terminal you would run

```
ssh -R 80:localhost:3000 ssh.localhost.run
```

And you would wait to get a response like the following 

```
Connect to http://MACHINENAME-7zhx.localhost.run or https://MACHINENAME-7zhx.localhost.run
```

Now you can give 1 of the above links to anyone to access on the internet or use them in you external testing environment.

The server will be running until you terminate the process

That is all, nothing else to it, no need for registering or any other hassle and its a free service.

Similarly you can use **serveo.net** service with the following command

```
ssh -R 80:localhost:3000 serveo.net
```

For serveo check with their [website](serveo.net) before using as they have their ups and downs lately.


## All similar services
- [localhost.run](localhost.run) (free, no registration)
- [serveo.net](serveo.net) (appears to be not working, free, no registration)
- [ngrok.com](ngrok.com) (paid, free trial, also free with no registration)
- [no-ip.com](no-ip.com) (paid, free trial, free with monthly re-registration)
- [cloudflare argo tunnel](https://developers.cloudflare.com/argo-tunnel/trycloudflare/) (free, no registration)
- [dyn.com](https://dyn.com/remote-access/) (paid, free trial)
- [Docker tunnel](https://github.com/kingsquare/docker-tunnel) (free, needs setup)
- [Docker tunnel](https://github.com/vitobotta/docker-tunnel) (free, needs setup)
- [Do it yourself tutorial](https://medium.com/@gabriel.bentara/ngrok-you-might-not-need-it-de4e3e34a55d) (free, needs setup)

Please post any other similar services you have in mind or using with any advantages that they might have or send me any corrections to the above list.

## WARNING
Some people have raised concerns in the comments that using such a service is actually in violation of your ISP's terms and conditions.  This includes usage of any of the alternatives.  There is probably a very slight possibility that an ISP can know or detect such a connection though.