# Test Webhooks on Localhost with Hookdeck CLI Quickstart

In this quickstart, you'll learn how to test and debug webhook integrations on your localhost using the Hookdeck CLI. You'll set up a local development environment that receives real webhooks from webhook providers, inspect requests in real-time, and debug your webhook handlers without deploying code.

[Learn the key concepts](/docs/use-cases/test-debug-localhost "Read the overview to understand how local webhook testing fits in your development workflow.")

You will walk through these steps:

1. Install and authenticate the Hookdeck CLI
2. Start your local development server
3. Connect the CLI to forward webhooks to localhost
4. Send a test webhook and see it arrive locally
5. Test with a real third-party provider
6. Inspect and debug webhooks
7. Retry webhook events

## 1. Setup the Hookdeck CLI and create a Hookdeck account

Install the [Hookdeck CLI](/docs/cli).

Run `hookdeck login` in your terminal to authenticate. If you don't already have a Hookdeck account, follow the instructions to create one.

```bash
hookdeck login

```

The CLI will open your browser for authentication. Once complete, you'll see a confirmation in the browser window and in your terminal.

## 2. Start your local development server

> If you already have a local server set up to receive webhooks, you can skip this step.

Set up a simple webhook handler on your local machine:

## 3. Connect the CLI to your local server

With your local server running, start the Hookdeck CLI to get a public URL to be used as the webhook endpoint with your webhook provider and to forward webhooks to your local server:

In a **new terminal window**, run:

```bash
hookdeck listen 3030 test-webhooks --path /webhook

```

You'll see output like:

```bash
●── HOOKDECK CLI ──●

Listening on 1 source • 1 connection • [i] Collapse

test-webhooks
│  Requests to → https://hkdk.events/src_{source_id}
└─ Forwards to → http://localhost:3030/webhook

💡 View dashboard to inspect, retry & bookmark events: https://dashboard.hookdeck.com/events/cli?team_id=...

Events • [↑↓] Navigate ──────────────────────────────────────────────────────────

> Waiting for events | [i] Expand connection info • [q] Quit

```

**What this does:**

1. Creates a [Source](/docs/sources) named `test-webhooks` that represents the webhook sender (Stripe, Shopify, GitHub, or any webhook provider). Use URL prefixed with "Requests to" (the **Source URL**) as the webhook URL with your provider.
2. Creates a [Destination](/docs/destinations) named `cli-test-webhooks` that defines where webhooks are delivered. It forwards incoming webhooks to your local server at `http://localhost:3030/webhook` via the CLI.
3. Creates a [Connection](/docs/connections) that routes events from the Source through the CLI Destination to your machine.

Keep this terminal window open. The CLI needs to stay running to forward webhooks.

## 4. Send a test webhook

Now that everything is connected, send a test webhook to see it arrive on your local server:

In a **third terminal window**, send a test webhook to your Source URL:

Replace `{YOUR_SOURCE_URL}` with the **Source URL** (the one prefixed with "Requests to" in the terminal output).

**What happens:**

1. **Hookdeck receives** the webhook at your Source URL
2. **Hookdeck tunnels** the event to the CLI
3. **CLI logs** the event in your terminal
4. **CLI forwards** the request to your local server at `http://localhost:3030/webhook`
5. **Your server processes** the webhook and returns a response

You should see output in three places:

**In your cURL terminal:**

```json
{
  "status": "SUCCESS",
  "message": "Request successfully handled",
  "request_id": "req_xyz789"
}

```

**In your CLI terminal:**

```bash
●── HOOKDECK CLI ──●

Listening on 1 source • 1 connection • [i] Expand

Events • [↑↓] Navigate ─────────────────────────────────────────────────

> 2025-10-27 16:51:39 [200] POST http://localhost:3000/webhook (11ms) → https://dashboard.hookdeck.com/events/evt_{id}  

```

**In your local server terminal:**

## 5. Retry webhook events

One of the most powerful features for local development is event retry. Once Hookdeck has captured a webhook, you can retry it to your local server instantly.

![Retry webhooks from the Hookdeck CLI](@/content/cli/images/hookdeck-cli-v1.1.0-retry.gif)

The CLI provides instant retry through keyboard shortcuts:

In your running CLI session, use the interactive controls:

1. **Navigate events**: Press `↑` or `↓` to select the event you want to retry
2. **Retry**: Press `r` to instantly retry the selected event to your local server
3. **View details**: Press `d` to see full request/response data

The selected event is indicated by a `>` character. When you press `r`, the webhook is immediately retried to your local server, appearing in your CLI output and server logs.

You can also retry events from the [Hookdeck dashboard](https://dashboard.hookdeck.com/events) by clicking the **Retry** button on any event.

## 6. Inspect and debug webhooks

The CLI provides powerful debugging tools right in your terminal.

![Retry webhooks from the Hookdeck CLI](@/content/cli/images/hookdeck-cli-v1.1.0-navigate.gif)

Use the interactive CLI controls to inspect webhooks:

* **Press `d`** to view full request/response details for the selected event
* **Press `↑`/`↓`**  (or `k`/`j`) to navigate between webhook events
* **Press `o`** to open an event in the dashboard for deeper inspection

For advanced debugging workflows, troubleshooting, and production best practices, see the [complete guide](/docs/use-cases/test-debug-localhost#debugging-webhooks-locally).

## 7. Test with a real provider

Now that you've tested with manual webhooks, connect a real third-party provider:

Register your **Source URL** with your webhook provider (Stripe, Shopify, GitHub, etc.). The specific steps depend on the provider - check their documentation for "webhook configuration" or "webhook URL".

Trigger an event in the provider's platform (create an order, push code, etc.).

Watch as the real webhook flows through Hookdeck and arrives at your local development server.

## Next steps

Now that you're successfully testing webhooks locally, explore more advanced topics:

[Advanced CLI Usage & Troubleshooting](/docs/use-cases/test-debug-localhost "Learn about testing failure scenarios, advanced CLI features, and common issues")

[Configure Source Authentication](/docs/sources#add-source-authentication "Learn how to set up authentication for your webhook sources")

[Configure Retry Behavior](/docs/retries "Learn how to set up automatic retries for failed webhooks")

[Filter Webhook Events](/docs/filters "Route only specific webhook events to your handlers")