How to install Ngrok on Kali Linux

How To Install Ngrok In Kali Linux

Install the ngrok agent from ngrok’s APT repository, add your authtoken, then point a tunnel at a service already listening on Kali Linux. The command ngrok http 8080 publishes the local service on port 8080 through an HTTPS endpoint, so you can share a development server without opening your router to inbound traffic.

What ngrok does on Kali Linux

ngrok runs an agent on your machine and forwards an internet-facing endpoint to a local address such as http://localhost:8080. The service must already work locally before you create a tunnel.

Use this for a development preview, a webhook receiver, or a temporary demonstration. It does not replace access control, and you should stop the tunnel when you no longer need the endpoint.

Install the ngrok agent with APT

Kali is Debian-based, so ngrok’s Debian APT repository is the direct installation route. The repository command uses the Bookworm distribution name from ngrok’s Linux download page.

ngrok Linux download page with the Linux tab selected
The ngrok Linux download page also lists the APT and archive installation options.

The download page lets you choose an architecture when you need the archive instead. Use the APT route below for a standard x86-64 Kali installation, and use the architecture picker only when your device needs a different build.

ngrok Linux archive architecture selector
Choose an archive architecture only when the APT package is not the right fit for your machine.
curl -sSL 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 bookworm main"   | sudo tee /etc/apt/sources.list.d/ngrok.list   && sudo apt update   && sudo apt install ngrok

Confirm that the executable is on your PATH before you add account credentials.

ngrok version

If APT cannot find the package, check that the repository file contains bookworm and run sudo apt update again. Package management on Linux explains how repository metadata and package installation fit together.

Add your ngrok authtoken

Create an ngrok account or sign in and copy the authtoken from the dashboard, treating it as an account credential that does not belong in screenshots, shared shell history, or source control.

ngrok account sign-up form
You need an ngrok account before the agent can use your authtoken.

The dashboard keeps the token in the account setup area for the command you run in your own terminal.

ngrok dashboard installation page with an authtoken command
The dashboard shows the account-specific command used to register the agent.
ngrok config add-authtoken YOUR_AUTHTOKEN

Replace YOUR_AUTHTOKEN with your own value, then run ngrok config check to inspect the configuration and use Linux command-line basics if you need help moving through directories and working safely with commands.

Start a local service before opening a tunnel

Use a port that already answers on localhost. For an Apache test site, open http://127.0.0.1 in your Kali browser first and confirm the page loads.

Apache2 default page loading from 127.0.0.1
A working local Apache page gives ngrok a service to forward.

When the browser cannot reach the local site, fix that service before starting ngrok. Run ss to verify the listener and use netstat and ss on Linux when you need to inspect which process owns a port.

Create an HTTP tunnel

Run the tunnel command with the port used by your local application. This example forwards an Apache service listening on port 80.

ngrok http 80
Kali terminal showing the ngrok HTTP command for localhost port 80
The tunnel command names the local address and port that ngrok should forward.

ngrok prints a forwarding HTTPS URL after it connects, and the terminal must stay open until you stop the tunnel with Ctrl+C.

ngrok terminal status with a forwarding HTTPS address
The forwarding row is the public HTTPS address mapped to the local Apache service.

Open the forwarding URL in a separate browser or send it to a collaborator from a connection outside your local machine.

ngrok public HTTPS address showing the Apache2 default page
The public ngrok URL shows the page served by Apache on the local machine.

Troubleshoot the two common checks

If ngrok reports that it cannot reach the upstream address, the local service is not listening on the port you supplied. Check the address in your browser, inspect the listener with ss, and rerun the tunnel with the matching port.

If the agent cannot authenticate, register the authtoken again from the account dashboard rather than pasting a token from another machine. Linux networking and DNS configuration helps when name resolution or a network connection prevents the agent from reaching ngrok.

For Kali-specific command context, keep essential Kali Linux commands nearby while you work through the setup.

FAQ

Can I install ngrok on Kali Linux with APT?

Yes. Kali is Debian-based, and ngrok provides a Debian APT repository. Add the repository key and source, run apt update, then install the ngrok package.

Do I need an authtoken for ngrok?

You need an ngrok account authtoken to register the agent with your account and create tunnels under that account.

Why does ngrok say it cannot reach my local address?

The local service is not responding at the address or port supplied to ngrok. Open the local address first, inspect its listener with ss, then use the matching port in the tunnel command.

Start with a local page you can already open, publish the matching port through ngrok, and stop the tunnel after the preview or test is complete.