localhost:5678: Running the n8n Editor

n8n, the workflow automation tool, opens its editor at http://localhost:5678 when you self-host it with npx n8n or Docker. The page appears once the terminal says the editor is accessible. Webhooks created there use localhost:5678 too, which outside services cannot reach, so set WEBHOOK_URL to a public address before relying on them.

n8n settings tied to the port
VariableDefaultWhat it changes
N8N_PORT5678The port n8n listens on
WEBHOOK_URLBuilt from host and portThe public base URL shown for webhooks
N8N_HOSTlocalhostHost name used in generated links

Updated

Running n8n locally is a quick way to build automations, but everything lives in the .n8n folder of the user who runs it. In Docker that folder is inside the container unless you mount a volume, which is why workflows can vanish after a restart.

Run n8n with saved data

Docker with a named volume

Replace the WEBHOOK_URL line with your public address, or remove it for purely local use.

docker volume create n8n_data
docker run -it --rm --name n8n \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  -e WEBHOOK_URL=https://automations.example.com/ \
  docker.n8n.io/n8nio/n8n

Moving from local to always on

A laptop that sleeps stops every scheduled workflow. For automations that must run at night, host n8n on a server, set WEBHOOK_URL and an encryption key, and put HTTPS in front of it.

Automations like these often sit behind a business website; We.Inc can build and host that site, leaving n8n to run only the workflows.

How it works

  1. Start n8n with npx n8n, or the Docker command below.
  2. Open http://localhost:5678 and create the owner account.
  3. Mount a volume so the data folder survives container restarts.
  4. Set WEBHOOK_URL to a public HTTPS address before sharing webhook links.

Tips

  • A webhook node shows a test URL and a production URL. The production one works only after the workflow is activated.
  • A tunnel gives a temporary public address for testing; restart n8n with WEBHOOK_URL set to it so the editor shows the right links.
  • If 5678 is taken, set N8N_PORT, or keep n8n on 5678 inside Docker and map a different host port.

Frequently asked questions

How do I open n8n on localhost:5678?

Run npx n8n with Node installed, or start the official Docker image with -p 5678:5678. When the log says the editor is accessible, open the address in a browser.

Why did my n8n workflows disappear?

The container was recreated without a volume, so its data folder was thrown away. Mount a named volume at /home/node/.n8n to keep workflows and credentials.

Why do external services fail to call my n8n webhook?

The webhook URL points at localhost:5678, which only your machine understands. Expose n8n through a tunnel or a public server and set WEBHOOK_URL to that address.

How do I change the n8n port?

Set the N8N_PORT environment variable, for example N8N_PORT=5679 npx n8n, then open the new port.

Related: GitHub webhooks, Webhook vs API, localhost refused to connect, Docker Compose env files.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Guides

Product

Who It's For

Features

Resources

Company

View Sitemap