Docker - n8n Docs
Docker - n8n Docs
Docker Installation
You can also use n8n in Docker with Docker Compose. You can �nd
Docker Compose con�gurations for various architectures in the n8n-
hosting repository.
• Con�guring n8n
n8n recommends self-hosting for expert users. Mistakes can lead to dat� loss, security issues,
and downtime. If you aren't experienced at managing servers, n8n recommends n8n Cloud.
1 of 7 5/19/25, 01:52
Docker | n8n Docs https://docs.n8n.io/hosting/installation/docker/#n8n-wi...
Prerequisites
Before proceeding, install Docker Desktop.
Linux Users
Docker Desktop is available for Mac and Windows. Linux users must install Docker Engine and
Docker Compose individually for your distribution.
n8n releases � new minor version most weeks. The latest version is for production use. next
is the most recent release. You should treat next as � beta: it may be unstable. To report
issues, use the forum.
Starting n8n
From your terminal, run:
2 of 7 5/19/25, 01:52
Docker | n8n Docs https://docs.n8n.io/hosting/installation/docker/#n8n-wi...
When using PostgreSQL, it's still important to persist the dat� stored in
the /home/node/.n8n folder. This includes n8n user dat� and, even
more importantly, the encryption key for credentials. It's also the name
of the webhook when using the n8n tunnel.
Keep in mind
While persisting the /home/node/.n8n directory with PostgreSQL is the recommended best
practice, it's not explicitly required. You can provide the encryption key by passing the
N8N_ENCRYPTION_KEY environment variable when starting your Docker container.
3 of 7 5/19/25, 01:52
Docker | n8n Docs https://docs.n8n.io/hosting/installation/docker/#n8n-wi...
Setting timezone
To de�ne the timezone n8n should use, you can set the
GENERIC_TIMEZONE environment variable. Schedule-oriented nodes,
like the Schedule Trigger node use this to determine the correct
timezone.
You can set the system timezone, which controls what some scripts
and commands like date return, using the TZ environment variable.
Updating
To update n8n, in Docker Desktop, navigate to the Images tab and
select Pull from the context menu to download the latest n8n image:
4 of 7 5/19/25, 01:52
Docker | n8n Docs https://docs.n8n.io/hosting/installation/docker/#n8n-wi...
You can also use the command line to pull the latest, or � speci�c
version:
After pulling the updated image, stop your n8n container and start it
again. You can also use the command line. Replace <container_id>
in the commands below with the container ID you �nd in the �rst
command:
5 of 7 5/19/25, 01:52
Docker | n8n Docs https://docs.n8n.io/hosting/installation/docker/#n8n-wi...
If you run n8n using � Docker Compose �le, follow these steps to
update n8n:
Further reading
You can �nd more information about Docker setup in the README �le
for the Docker image.
Use this for local development and testing. It isn't safe to use it in production.
6 of 7 5/19/25, 01:52
Docker | n8n Docs https://docs.n8n.io/hosting/installation/docker/#n8n-wi...
can redirect requests from n8n's servers to your local n8n instance.
Next steps
• Learn more about con�guring and scaling n8n.
7 of 7 5/19/25, 01:52