Skip to main content

How to Share Your Local WordPress Website with Ngrok on Ubuntu

 How to Share Your Local WordPress Website with Ngrok on Ubuntu

Are you running a WordPress website locally using Local WP (formerly Local by Flywheel) and want to access it from another device or share it with a client or friend over the internet?

Using ngrok, a powerful tunneling tool, you can expose your local site securely to the world in just a few commands.


🚀 What is Ngrok?

ngrok is a tool that creates a secure tunnel from the public internet to your local machine. This is especially useful when:

  • You want to test your local WordPress site on a mobile device

  • You need someone to preview your project remotely

  • You're demoing your work in real time


🧱 Prerequisites

  • A working local WordPress site running in Local WP

  • Ubuntu (tested on Ubuntu 22.04 and similar)

  • Internet connection

  • Terminal access


🔧 Step 1: Install Ngrok on Ubuntu

Open your terminal and paste the following command:

curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && \
echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && \
sudo apt update && sudo apt install ngrok

This will:

  • Add the official ngrok repository

  • Update your package list

  • Install the ngrok tool


🧭 Step 2: Set Local WP to “localhost” Mode

Before using ngrok, make sure Local WP is using Router Mode: localhost

  1. Open Local WP

  2. Go to Preferences > Advanced

  3. Change Router Mode from Site Domains to localhost

  4. Click Apply, then restart your site

Now your local site URL will look like:

http://localhost:10005

Note: The port may vary — check your site details in Local WP.


🔐 Step 3: Connect Ngrok to Your Account (Optional but recommended)

You can use ngrok anonymously, but creating an account gives more features (like custom subdomains).

  1. Go to: https://dashboard.ngrok.com/get-started/setup

  2. Sign up / log in

  3. Copy your auth token

  4. Run in terminal:

ngrok config add-authtoken <your_token_here>

🌐 Step 4: Start the Tunnel

Let’s say your WordPress site runs on port 10005 (confirm in Local WP). Then run:

ngrok http 10005

You will see output like this:

Forwarding                    https://abc123.ngrok.io -> http://localhost:10005

🎉 That's your public link! You can now:

  • Open it on another device

  • Share it with a friend, client, or tester

  • Use it in browser or mobile


📥 Example Use

You have a local WP site at:

http://localhost:10005

After running ngrok, you get:

https://swift-sun-8923.ngrok.io

You (or anyone else) can now open that https:// link and see your site as if it were hosted online!


🚫 How to Stop the Tunnel

When you're done, simply press:

CTRL + C

Ngrok will stop, and the public link will no longer work.


🔁 Reuse Later

Every time you run:

ngrok http 10005

You’ll get a new public link (unless you're on a paid plan with reserved domains).

To reuse the same domain, use:

ngrok http --subdomain=yourname 10005

(Requires a paid ngrok plan)


🔒 Security Tip

  • Your site is exposed publicly while the tunnel is open.

  • Don’t leave it running unattended.

  • Don’t share the link with people you don’t trust.


📌 Summary

Task Command
Install ngrok See Step 1
Start sharing site ngrok http 10005
Stop sharing CTRL + C
Check IP address ip a
Add auth token ngrok config add-authtoken <token>

✅ Final Thoughts

Ngrok makes it incredibly easy to preview, test, and share your local WordPress site without setting up hosting or DNS. It’s perfect for development teams, freelancers, or students working on class projects.

Let me know if you want help:

  • Automating this process

  • Using custom domains

  • Or securing your tunnel with a password

Happy developing! 🧑‍💻🌐

Comments

Popular posts from this blog

Introduction

Name: Muhammad Tabassat DOB: 10 june 2004 Muhammad Tabassat

Download individual YouTube video/audio or entire playlists via the Ubuntu terminal

1. First of all Install yt-dlp in ubuntu terminal bash sudo apt update sudo apt install yt-dlp If it's not found or outdated, use Python: pip install -U yt-dlp 2. Install FFmpeg (for MP3 conversion) sudo apt install ffmpeg 3. Download audio of a single video link: yt-dlp -x --audio-format mp3 "Add video link" yt-dlp -x --audio-format mp3 "Add video link" for example yt-dlp -x --audio-format mp3 " https://youtu.be/GVbg-sblIg4?si=tccCB6nw-PiQwCbB " 4. Download audio of playlist link: yt-dlp -x --audio-format mp3 "Add playlist link" yt-dlp -x --audio-format mp3 "Add playlist link" 5. Download videos of playlist link: yt-dlp -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "Add playlist link" yt-dlp -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "Add playlist link" 6. Download single video link: yt-dlp "link" yt-dl...