How to properly deploy N8N in docker 🐳

Deploying N8N On Docker :whale:

so, I tested N8N on my pc,
now, I am looking on the docs to deploy it on a server with docker, and its quite confusing

Configuration For Docker Deployment

Simple Deployment With Reverse Proxy And User Management

sudo docker run -it --rm \
	--name n8n \
	-p 5678:5678 \
	-v ~/.n8n:/home/node/.n8n \
	-e N8N_BASIC_AUTH_ACTIVE="true" \
	-e N8N_BASIC_AUTH_USER="thefourCraft" \
	-e N8N_BASIC_AUTH_PASSWORD="somepasswrod" \
	-e N8N_EMAIL_MODE="smtp"\
	-e N8N_SMTP_HOST=""\
	-e N8N_SMTP_PORT="587"\
	-e N8N_SMTP_USER="thefourCraft"\
	-e N8N_SMTP_PASS="somepasswrod"\
	-e N8N_SMTP_SENDER="[email protected]"\
	-e TZ="something from this -" \
	-e N8N_HOST="localhost"\
	-e N8N_PORT"5678"\
	-e N8N_PROTOCOL"http"\

also, it’s behind the Cloudflare tunnel proxy so how can I do that? Are any additional settings needed?
because currently, my API redirects aren’t working :face_with_monocle:

I really appreciate any help you (the community) can provide :love_you_gesture:

Hey @thefourCraft,

When you say the API redirects are not working what do you mean? Is there an error message maybe? It looks like you have not set the URL either so it would likely be trying to connect to localhost which may not work as expected.

On the Cloudflare side I would recommend turning off the proxy option if it is on DNS as the caching can sometimes cause issues so it is worth simplifying the setup then start to toggle extra features.

How can I access the configuration for the docker?

Hey @thefourCraft,

The configuration for the n8n container is set using the environment variables (the -e flags in your example).

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.