How to Install n8n with Portainer & Docker CLI 🛠️

:wave: Hey n8n community. I have created a short tutorial video on how to install n8n with portainer and docker CLI.

5 Likes

Hey @m3tam3re,

This is very cool, I am a big fan of Portainer and I might start linking folk to this instead of my own blog post on the same subject. Nice work :raised_hands:

3 Likes

@m3tam3re Does it read local files? I had tried installing via docker command but could not access files on my pc

You can share files from your host machine with the container by creating another volume. You could for example add this to your docker command:

-v /path/on/host:/home/node/host-data

This will mount the path /path/on/host into the folder /home/node/host-data in the n8n container

To test it you can just use the “Execute Command” node and execute

ls /home/node/host-data
1 Like

Thanks. I have been struggling with this, so on the local version I use the npm one

1 Like

I couldnt get it wodking. My path Is C:\Users\Win 10 Pro and each time I try adding this it doesnt work

@Imperol how did you try mounting the volume? When you say it doesn’t work are you remembering to try and and access it using the linux path rather than the windows path as well?

I haven’t been using docker on windows a lot, but I have tried to reproduce this. The docker windows situation seems to be a bit complicated when it comes to sharing host folders to the container.

This is how I got it running:

  1. You need to enable file sharing. So you will need to disable the “Use the WSL 2 based engine” in the Docker Desktop settings.

  2. You need to enable Hyper-V in a Powershell admin window:
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

  3. Now you should have a new entry “File sharing” in Docker Desktop/Resources

  4. Add one or more folders

  5. Now you should be able to add the volume:
    docker run -it --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n -v "/C/Users/Win 10 Pro:/home/node/host-data" docker.n8n.io/n8nio/n8n:latest
    The quotes are needed as you have spaces in your path.

Please note that Window paths need to be changed to the Linux syntax by replacing \ with/. See details here:

Please make sure to backup important data and read the docs:

1 Like

Thanks for this. it seams this will be consuming more resources than necessary. I’ll upload the files then read them from an online database

This tutorial nor your tutorial mention encryption keys. I ran into the same encryption key problem the next day before I had a chance to add my own encryption keys