How to add custom nodes on Docker Configuration

hello community, I’m trying to add custom nodes in my n8n instance in docker but I’ve read many forums, guides and I can’t find the key. See if someone can help me out.
I have read that you have to put them inside a Custom folder and so on, but there is no way to make it work.

My docker-compose.yml file:

version: "3"
    image: "traefik"
    restart: always
      - "--api=true"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - ""
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
      - "${SSL_EMAIL}"
      - ""
      - "80:80"
      - "443:443"
      - ${DATA_FOLDER}/letsencrypt:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock:ro

    image: n8nio/n8n
    restart: always
      - ""
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
      - traefik.http.routers.n8n.tls=true
      - traefik.http.routers.n8n.entrypoints=web,websecure
      - traefik.http.routers.n8n.tls.certresolver=mytlschallenge
      - traefik.http.middlewares.n8n.headers.SSLRedirect=true
      - traefik.http.middlewares.n8n.headers.STSSeconds=315360000
      - traefik.http.middlewares.n8n.headers.browserXSSFilter=true
      - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
      - traefik.http.middlewares.n8n.headers.forceSTSHeader=true
      - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
      - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
      - traefik.http.middlewares.n8n.headers.STSPreload=true
      - [email protected]
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - ./n8n:/home/node/.n8n

Hi @Alberto_Luque_Rivas

You can use the community nodes option to get this done.
Or are you talking about private nodes?

1 Like

I need developer my custom private nodes

I think you need made your own docker image, It’s very simple , you can make it base on example on github n8n/docker/images at master · n8n-io/n8n · GitHub . I personal use debian version.

You can create a ‘custom’ folder in ‘.n8n’ and then upload your node’s entire folder there

e g.
put your node’s compiled files in .n8n/custom/node_name/v1/

and then recreate the docker containers.

Take a look at the settings:

That’s what I’m doing and it doesn’t work, when you mention a compiled node what do you mean? Following the node creation guide I follow the format “name.node.ts”, the ExampleNode is taken from an official git repository

Hi @Alberto_Luque_Rivas

You need to build the node with ‘npm build’ before you can use it.
Before the community nodes feature was released I published the node to npm and then created a new docker file including the installation via npm.
There should be a topic somewhere on the community with instructions on how to do that.

The other option of including the custom nodes in the custom folder never worked for me. Don’t know anymore what the reason was.

Check this out:

Once you have successfully built the node, you’ll find a ‘dist’ folder in your working directory. This dist folder will contain your compiled node, which you then need to copy over to the custom folder of your n8n instance, as mentioned above.

1 Like