N8n docker importing custom nodes safely and persistent

Hey team

What would be the best practice in regards to importing a community node into a docker - and making it persistent?

There are a few community nodes such as the Google Ads api that arent yet in the formal lib, keen to get these into our n8n instances safely.

Secondly - is there roadmap scope to have nodes to be imported from the UI?


Hey @Dwayne_Taylor,

I am not a member of the n8n team but I have installed custom node modules in n8n images recently.

There is this section in the docs explaining how to install a custom node module. Any changes that you make to a Docker container are not persistent when not using Docker volumes or mounting directories to your container. This means that you should probably build your own container.

For this you need to install Docker, and then create a Dockerfile. This file tells Docker which steps to perform to create your container. You can either copy and paste the Dockerfile from n8n docs or create an even simpler one:

# The base image you will be using is the latest prebuilt n8n image
FROM n8nio/n8n:latest

# Go into the directory where n8n is installed and install your custom module
RUN cd /usr/local/lib/node_modules/n8n && npm install @digital-boss/n8n-nodes-google-ads

You can then build your Docker image running the following command in the folder where your Dockerfile is located:

docker build -t yourImageName:latest .

Let me know if you need any further help.


This is how I do it at the moment, We are working on making installing custom nodes easier so soon (not sure on dates) this process will be a lot better.


Hi @Jon
Any news on this? Should i use the mentioned flow nowadays, or are there any better options?

There actually are news @yavetal. Assuming you self-host n8n, you can now install custom nodes through the UI. Check out Installation and management - n8n Documentation for details :slight_smile:


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