Home » n8n» n8n webhook node how to use — Beginner Docker Guide

Guide: n8n webhook node how to use?

This guide shows n8n webhook node how to use in Docker and Node.js. You can use the n8n webhook node to receive HTTP requests and trigger workflows in seconds. The examples below work on a local Docker setup or a simple Node.js install.

What You Need

  • Docker installed or Node.js and npm.
  • An n8n account or local n8n instance.
  • Basic cURL or Postman for testing.
  • A simple workflow idea, like saving a POST payload.

Step-by-step: n8n webhook node how to use

Step 1: Run n8n with Docker

Start n8n in a container. This runs the server on port 5678 by default.

docker run -it --rm -p 5678:5678 --name n8n -e N8N_BASIC_AUTH_ACTIVE=true -e N8N_BASIC_AUTH_USER=admin -e N8N_BASIC_AUTH_PASSWORD=strongpass n8nio/n8n

Or use docker-compose for a persistent setup.

version: '3'
services:
  n8n:
    image: n8nio/n8n
    ports:
      - '5678:5678'
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=strongpass
    restart: unless-stopped

Step 2: Start n8n with Node.js (alternative)

Install and run n8n directly with npm for local tests.

npm install -g n8n
n8n start

Step 3: Create a Workflow and Add a Webhook Node

1. Open http://localhost:5678 and log in.

2. Create a new workflow.

3. Add the Webhook node. Choose POST or GET and set a path, for example receive/test.

4. Save and activate the workflow. n8n shows the full webhook URL when the node is selected.

Step 4: Test the Webhook with cURL

Send a request to the shown URL. Replace the path with your node path.

curl -X POST 'http://localhost:5678/webhook/receive/test' -H 'Content-Type: application/json' -d '{"name":"Alice"}'

n8n receives the JSON and continues the workflow. You can add nodes to parse, store, or forward the data.

Step 5: Numbered Logic (how it works)

1. An HTTP request arrives at the webhook URL.

2. n8n captures the request data and headers.

3. The workflow triggers connected nodes in order.

4. Nodes process, transform, or send the data to services.

Update

To update the Docker image, pull and recreate the container.

docker pull n8nio/n8n
docker stop n8n && docker rm n8n
# then run the docker run command again

For npm installs use:

npm update -g n8n

Security

Do not expose n8n without protection. Use basic auth or a reverse proxy with HTTPS. Set environment variables to enable auth.

  • Enable basic auth: N8N_BASIC_AUTH_ACTIVE=true.
  • Use strong credentials and rotate them.
  • Use HTTPS via a proxy like Nginx or a managed service.
  • Limit webhooks with IP allowlists or tokens when possible.

Do not store secrets in plain text in shared repos. Use environment variables or a secrets store.

Done

You now know how to run and test a webhook with n8n using Docker or Node.js. The webhook node receives HTTP requests and triggers workflows. Add processing nodes to automate tasks next.


Neil
Written by Neil

Neil is a true n8n geek who lives and breathes workflow automation. He dives deep into nodes, triggers, webhooks, custom logic, and self-hosting setups, sharing everything he learns about n8n on AutomationCompare.com. As part of a broader team of automation specialists, Neil focuses purely on mastering n8n and helping others unlock its full potential.

Keep Reading

Scroll to Top