# How to test Mollie webhooks locally

Mollie uses webhooks to finalize payments, but testing them locally can be challenging because Mollie requires a public-facing URL to send notifications. Local URLs like `http://localhost:3000` or `http://localhost:8080` are not accessible from the internet.

**Solution: Use a Local Tunnel**

A local tunnel is a port-forwarding technique that exposes a local API service (running on a specific port) to the internet. This is done through a public HTTPS URL. It allows you to:

1. Make your local server accessible online temporarily.
2. Use the generated public URL in Mollie’s webhook settings.
3. Receive webhook events directly on your local development machine.

With a local tunnel, you can test and debug Mollie webhooks without deploying your application to a live environment. Here are two popular tools to create a secure public URL for testing Mollie webhooks:

1. [Ngrok](https://ngrok.com/?utm_source=docs.umbraco.com) is a widely used tool that creates a secure tunnel from your local machine to a public URL. It supports advanced configurations and works well with webhook-based systems.
2. [Beeceptor’s Local Tunnel](https://beeceptor.com/local-tunnel/?utm_source=docs.umbraco.com) gives a public HTTP mock server that allows you to expose your local server to the internet securely. Supports HTTPs, mock rules and comes with request history. The Free plan includes 50 requests/day per tunnel or endpoint.

The following guide will use [ngrok](https://ngrok.com/?utm_source=docs.umbraco.com) to create temporary tunnels through your network.

## Step 1: Install ngrok

1. Head on over to [ngrok.com](https://ngrok.com/?utm_source=docs.umbraco.com).
2. Download and install the tool on your system.

## Step 2: Launch ngrok

You can either launch ngrok from the command line or use the steps below to create a batch file to be run at any time.

1. Open NotePad.
2. Type the following:

```
C:\PROGRA~1\ngrok\ngrok.exe http -host-header=rewrite localhost:61191
```

3. Swap the local domain/port number at the end according to the configuration of your site.
4. Save the file as `ngrok.bat` at the root of your web project.

You can run the batch file at any time to launch ngrok and create a publicly accessible tunnel to your website.

![The ngrok UI.](/files/sPfiCwruprcmxizq5hgQ)

{% hint style="info" %}
When you launch ngrok for the first time, it will ask you to sign in. Enter the credentials you used to sign up. It will remember them from now on.
{% endhint %}

## Step 3: Test the site

With ngrok running you can test the site using the URLs displayed in the console window. The Mollie gateway will automatically be able to communicate back to your site instance.

You will see webhook requests displayed in the console window, and you can debug them using Visual Studio.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.umbraco.com/umbraco-commerce-payment-providers/mollie/how-to-guides/testing-mollie-webhooks-locally.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
