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.
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.
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.
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.
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:
If you already have a SSH key pair, to get the fingerprint enter:
ssh-keygen -lf /Users/devtoolbox/.ssh/id_rsa
/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
Next, add two records DNS records for the domain or subdomain you want to use:
- An A record pointing
- A TXT record in the form
.In our case, it will be
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
serveo.devtoolbox.co is the custom subdomain.
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.