When developing a web application, it's common to want to test it on multiple devices or share it with others before deploying it to a production environment. One way to do this is by using a tool called ngrok, which creates a secure tunnel to your local development server and exposes it to the internet.
In this tutorial, we'll go through the steps of installing and using ngrok with Laravel on Ubuntu.
To install ngrok, follow these steps:
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
unzip ngrok-stable-linux-amd64.zip
sudo mv ngrok /usr/local/bin/
To start Laravel's development server, open a terminal and navigate to your Laravel project's directory. Then, run the following command:
php artisan serve
This will start the development server on http://localhost:8000.
To start ngrok, open a new terminal and run the following command:
ngrok http 8000
To test the ngrok tunnel, open a web browser and navigate to one of the Forwarding URLs that you noted in the previous step. You should see your Laravel application running.
Congratulations! You've now successfully set up ngrok with Laravel on Ubuntu
© 2025. All rights reserved by Viktor Molnar.