Serveo: The Best and Free ngrok Alternative

Serveo is the best and free ngrok alternative when comes to exposing your local servers to the internet or localhost tunnelling.
Serveo: Best and Free ngrok Alternative

Serveo is the best and free ngrok alternative when comes to exposing your local servers to the internet or localhost tunnelling.

Compared to ngrok, Serveo requires no installation, or sign up since it’s using your existing SSH client. Plus, you can have a subdomain that is preserved across restarts or configure your own domain instead of using the default serveo.net.

Basic usage

To use Serveo, just open your Terminal and enter:

ssh -R 80:localhost:3000 serveo.net

That’s it. You will be assigned a random URL, a subdomain of serveo.net.

Serveo
Serveo SSH Tunnelling

To request a specific subdomain, you can use this command:

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

Just replace “devtoolbox” with the name of your choosing.

GUI session

This is not a real GUI per se since it’s still very much command line but it’s an interface where you can inspect requests or responses, very much like ngrok.

Serveo GUI Session
Serveo GUI Session
Serveo Requests Inspector
Serveo Requests Inspector

Using custom domain

To use custom domain, you will need to add some records to your DNS.

But first, you will need to get your SSH key fingerprint, and most likely you already have an SSH key pair generated. If you don’t, go ahead an generate a new key pair using this command:

ssh-keygen -l

If you already have a SSH key pair, to get the fingerprint enter:

ssh-keygen -lf /Users/devtoolbox/.ssh/id_rsa 

Where /Users/devtoolbox/.ssh/id_rsa is the path to your private key.

Then note down your key’s fingerprint. It looks something like this:

2048 SHA256:qWFLAaIpZPTbRUw2dkkwgodcUoubIlFkh4UKSthPY8L [email protected] (RSA)

The part you need is SHA256:qWFLAaIpZPTbRUw2dkkwgodcUoubIlFkh4UKSthPY8L.

Next, add two records DNS records for the domain or subdomain you want to use:

  1. An A record pointing to 159.89.214.31.
  2. A TXT record in the form of authkeyfp=[fingerprint]. In our case, it will be authkeyfp=SHA256:qWFLAaIpZPTbRUw2dkkwgodcUoubIlFkh4UKSthPY8L.

Note: If you have multiple users, e.g. your team members accessing the same custom domain or subdomain, you will need to add their SSH key’s fingerprint as well, as per step 2 above.

Now you can connect the the custom domain using this command:

ssh -R serveo.devtoolbox.co:80:localhost:3000 serveo.net

Where serveo.devtoolbox.co is the custom subdomain.

Serveo Custom Domain
Serveo Custom Domain

Wrapping up

Serveo might not be as feature-rich and stable compared to ngrok, but the ability to have custom domain is a winner for us here, plus there is no sign up at all.

Let us know in the comment section down below if you know any better ngrok alternative.


Newsletter Updates

Enter your email address below to subscribe to our newsletter

Leave a Reply