The easiest way to access your Raspberry Pi from the web for testing things out (like a simple web server) is to use a service called ngrok. It creates a secure tunnel to your Pi’s locally running server, giving you a simple public URL that you can use to access it from anywhere online.

A Pi floating over the globe

Your Pi shall soon be able to communicate with the globe!

To install it on your Pi, go, scroll to the “Download and Installation” section and copy the URL of the download link next to “Linux ARM”:

ngrok's download options

The “Download” button you’ll want to right click for the URL

Then, open up your command line/terminal on your Pi and type in the following, where the URL is the URL you copied from above:

wget ""

You’ll then need to have a way to unzip that file. If you haven’t unzipped anything on your Pi in the past, you’ll need to install the zip package using the following command:

apt-get install unzip

Then unzip ngrok using the following:


That will unzip the file “ngrok” at this location. Run it using the following command (replace “80” with the port you’d like to be able to access):

./ngrok http 80

You should see output that looks like so:

ngrok's output when running

Find the “Forwarding -> localhost:80” line, that’s your URL

The URL you’ll want will look like “” (ngrok will generate you a unique one, so don’t try this one!). If you enter your URL into wherever you are trying to access your Raspberry Pi from, you should access that service on your Pi, just as if you were accessing it from your local network! Well, not quite as quickly but still quite speedily!

(Note: you do not need to include the port number in that request as ngrok automatically is directing the request to the port you set)

Know other emerging tech enthusiasts who might want to read this too? Please like and share this post with them!

Would you like to republish this article in your own publication?
Contact Dev Diner to request official republication of this article.

Leave a Reply

Your email address will not be published.

Want more?