Как запустить n8n: Docker, редактор, первый Webhook-workflow, учётные данные
Self-hosted n8n в Docker: первый Webhook и основы хранения учётных данных.
You want to connect webhooks, HTTP APIs, and SaaS tools without writing a custom backend first. n8n is a workflow automation platform with a visual editor; official docs live at docs.n8n.io.
Searchers looking for n8n Docker установка редактор webhook workflow учётные данные need: run n8n in Docker, open the UI on port 5678, build a Webhook-triggered workflow, and understand how Credentials store API secrets. Steps follow n8n hosting and getting-started documentation.
Who n8n fits
Ops and full-stack devs wiring APIs
Replace ad-hoc cron scripts with nodes; Webhooks give you an HTTP entrypoint.
Small-team automation owners
Self-host in Docker so workflows and secrets stay on your volume, not scattered env files.
Migrants from Zapier/Make
Exportable workflows, custom HTTP nodes, and local Webhook URLs for debugging.
Install and start n8n with Docker
- 1
Docker ready
Install and start Docker Desktop (macOS/Windows) or Docker Engine on Linux. Confirm
docker --version. - 2
Project folder
mkdir ~/n8n-local && cd ~/n8n-local, createdocker-compose.yml. - 3
Service definition
Use image
docker.n8n.io/n8nio/n8n, map5678:5678, mount a named volume to/home/node/.n8nper docs.n8n.io/hosting. - 4
Bring up
docker compose up -d, thendocker compose logs -f n8nuntil the editor responds.
services:
n8n:
image: docker.n8n.io/n8nio/n8n
restart: unless-stopped
ports:
- "5678:5678"
environment:
- N8N_HOST=localhost
- N8N_PORT=5678
- N8N_PROTOCOL=http
- GENERIC_TIMEZONE=UTC
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:Before exposing n8n publicly, set N8N_ENCRYPTION_KEY, HTTPS, and authentication per official hosting docs — do not publish an unsecured 5678 port.
Open the n8n editor
- 1
Browser
Visit
http://localhost:5678. First launch creates an owner account (email + password) as prompted. - 2
Canvas
Node panel on the left, workflow canvas center, Executions and Settings in the header. Create a New workflow.
- 3
Save
Name the workflow (e.g.
Hello Webhook) and save before closing the tab.
First Webhook workflow
- 1
Webhook trigger
Add a Webhook node as the trigger. Pick
GETorPOSTfor practice. - 2
Copy URL
Use the node’s Test URL while debugging or Production URL when the workflow is active — paths show in the node panel.
- 3
Respond
Connect Respond to Webhook (or Set then Respond) to return JSON or text.
- 4
Test
Click Test workflow / listen for test event, then
curlthe Test URL. Check Executions for success. - 5
Activate
Toggle the workflow Active for Production Webhook traffic (see docs for test vs production paths).
Credentials basics
| Item | Role | Note |
|---|---|---|
| Credential | Stores OAuth tokens, API keys, DB logins | Encrypted in the instance; nodes reference by name |
| Create | Settings → Credentials or inline when adding a node | Pick the template matching the integration |
N8N_ENCRYPTION_KEY | Instance encryption secret | Set and backup in production; loss breaks stored creds |
| Export | Workflow JSON usually omits secrets | Recreate credentials after migration |
For HTTP nodes, prefer a Header Auth credential over pasting tokens into node fields you might export.
Webhook flows prove your HTTP entry; for Slack or GitHub, register the Production URL in the vendor console and add matching OAuth/API credentials in n8n.
Whiteboard an automation map with teammates from the wbroom homepage — create and join a room; for Docker basics see Docker Compose guide.
Questions worth checking
Port 5678 already in use?
Change host port in compose (e.g. 5679:5678), browse to the new port, and align N8N_PORT / reverse proxy settings per hosting docs.
Test vs Production Webhook URL?
Test URLs support editor debugging; Production URLs serve traffic when the workflow is active. Exact paths are shown on the Webhook node and in the docs.
Where are credentials stored?
On the mounted volume under the container’s .n8n data directory, encrypted by the instance. Keep the volume when recreating containers.
n8n Cloud vs self-hosted Docker?
Same editor concepts; Cloud hosting, billing, and public URLs are on n8n.io. This guide targets self-hosted Docker for local practice.