# n8n Docker Self-Hosting & HTTP Cheat Sheet

> Quick command reference for running n8n via Docker and configuring environments.

A concise reference guide detailing common Docker commands and essential environment variables for self-hosting n8n. It covers deployment commands, persistence volumes, core settings like SMTP and webhooks, and cURL import patterns for HTTP Request nodes.

## How it works

Docker self-hosting:

\# Install n8n docker

git clone https://github.com/n8n-io/self-hosted-ai-starter-kit.git

cd self-hosted-ai-starter-kit

\# Update latest version

sudo docker pull docker.n8n.io/n8nio/n8n

\# Stop container

sudo docker stop n8n

\# Remove container

sudo docker rm n8n

\# Docker Run (interactive mode, auto-restart policy, continues run, port mapping, persistent volume)

sudo docker run -it --rm --name n8n -p 5678:5678 -v n8n\_data:/home/node/.n8n docker.n8n.io/n8nio/n8n

Env vars: WEBHOOK\_URL (public webhook URL), N8N\_SMTP\_HOST/N8N\_SMTP\_PORT=465/N8N\_SMTP\_USER (SMTP port and user email), N8N\_SMTP\_PASS (SMTP app password), N8N\_SMTP\_SENDER (email sender), N8N\_SMTP\_SSL="true" (enable SSL for SMTP).

GENERIC\_TIMEZONE=Asia/Seoul (set timezone), N8N\_DIAGNOSTICS\_ENABLED=false (disable diagnostics), N8N\_VERSION\_NOTIFICATIONS\_ENABLED=false (disable version check), VUE\_APP\_URL\_BASE\_API (frontend base API URL).

N8N\_ENCRYPTION\_KEY (random strings, encryption key), N8N\_TEMPLATES\_ENABLED=false (disable templates), N8N\_USER\_FOLDER=/home/n8n (user folder path).

EXECUTIONS\_TIMEOUT=3600 (execution timeout s), EXECUTIONS\_TIMEOUT\_MAX=7200 (max execution timeout s).

N8N\_METRICS=true (Prometheus metrics), N8N\_CUSTOM\_EXTENSIONS="/home/n8n/n8n-custom-nodes; /data/n8n-nodes" (custom nodes path), N8N\_FUNCTION\_ALLOW\_BUILTIN=\* (allow built-in modules).

HTTP Request (API): Import cURL command — one-click auto fill. Example:

curl -X POST https://api.example.com/data \

-H "Content-Type: application/json" \

-H "Authorization: Bearer YOUR\_API\_TOKEN" \

-d '{"name": "Alice", "email": "alice@example.com"}'

## What it is for

- Deploy or update a self-hosted n8n instance using Docker
- Configure key n8n environment variables for webhooks, email, and security
- Import raw cURL commands directly into n8n HTTP Request nodes

## Key points

- Docker commands for cloning the starter kit, pulling updates, and managing containers
- One-line docker run command with port mapping and volume persistence
- Essential environment variable reference for SMTP email delivery and webhooks
- Security and system tuning flags for encryption keys, timeouts, and metrics
- Example cURL payload structure for importing into the HTTP Request node

## Pricing

Free

## Details

- Type: Tip
- Category: [Development](https://xiry.app/topics/development.md)
- Open source: yes
- Platforms: Linux, Command line, Self-hosted
- For: Developers and system administrators self-hosting workflow automation tools
- Tags: n8n, docker, automation, cheat sheet, self hosted

## Why it was saved

- [@boringmarketer, 14 April 2025](https://x.com/boringmarketer/status/1911575563107434768): Copy-paste commands and patterns for running n8n yourself and wiring APIs.

## Related

- [How to self-host a Next.js app on a Hetzner VM using Kamal](https://xiry.app/resources/how-to-self-host-a-next-js-app-on-a-hetzner-vm-using-kamal): Step-by-step tutorial for deploying Next.js to Hetzner using Kamal (Article or course, Free)
- [Coolify](https://xiry.app/resources/coolify): Open-source, self-hosted platform alternative to Heroku, Vercel, and Railway (Web app, Freemium)
- [JSON2Video](https://xiry.app/resources/json2video): Video editing API and visual editor for automated programmatic video generation. (Web app, Freemium)
- [n8n](https://xiry.app/resources/n8n): Visual workflow automation platform with custom code and AI agent capabilities. (Web app, Freemium)
- [n8n Cheat Sheet: Shortcuts, Expressions & Node Settings](https://xiry.app/resources/n8n-cheat-sheet-shortcuts-expressions-and-node-settings): Quick reference for n8n canvas navigation, expression syntax, and node behaviors (Tip, Free)
- [n8n-workflows](https://xiry.app/resources/n8n-workflows): Curated collection of over 2,000 ready-to-import n8n automation and AI workflows. (GitHub repo, Open source)

Updated 11 October 2026. Page: https://xiry.app/resources/n8n-docker-self-hosting-and-http-cheat-sheet

Make your own library: Xiry takes your saved reels, tweets, Reddit bookmarks and Watch Later videos, makes them searchable and pulls the useful stuff out, like this library. It's invite-only for now; join the waitlist at https://xiry.app/#waitlist.
