N8n custom nodes with Docker

I’d like to execute custom nodes using my actual n8n system. I’ve prepared setup a docker-compose.yaml to run specific web requests. I tried execute npm run build (to prepare and test node) outside my container, at my n8n-nodes-* folder, and put it in n8n_data, to send for my local n8n server in execution. The npm link doesn’t work, probably because I couldn’t create a link directly from my local folder to container’s volume, so this is why I only ran npm build.

services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    container_name: n8n
    restart: always
    environment:
      - WEBHOOK_URL=http://localhost:5678
      - N8N_SECURE_COOKIE=false
    ports:
      - '5678:5678'
    volumes:
      - n8n_data:/home/node/.n8n
      - n8n-nodes-starter:/home/node/.n8n/nodes/node_modules/n8n-nodes-starter

volumes:
  n8n_data: {}
  n8n-nodes-starter: {}

Well, I already changed the name from package.json, and deleted all files and recreated them, but it still not working and no custom nodes are showing in nodes panel (and no errors are plotted). Any tips to solve this? The docs apparently just show for a local node.js installation, and the proposed Dockerfile uses version 16-alpine, which refuses to start n8n (private node section), so I can’t move next with it.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
  • **n8n version: 1.63.4
  • **Database (default: SQLite): default
  • **n8n EXECUTIONS_PROCESS setting (default: own, main): WEBHOOK_URL=http://localhost:5678, N8N_SECURE_COOKIE=false
  • **Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • **Operating system: Arch Linux

Hey @megarubber

Assuming n8n-nodes-starter is the path to your local node the path in the container should be /home/node/.n8n/custom

The example node is not showing. Do you have another suggestion?

I execute git clone, with npm run build. I want test with Example Node of this rep GitHub - n8n-io/n8n-nodes-starter: Example starter module for custom n8n nodes.

The edits for docker compose:

    volumes:
      - n8n-nodes-starter:/home/node/.n8n/custom

volumes:
  n8n-nodes-starter: {}

Hey @megarubber

Do you have the files in the n8n-nodes-starter volume you are using? Don’t forget that volumes are different to binds which are local file paths so if you have not moved the files to the volume I would have the first path of the volume mount to a bind / local file
Path instead.

Yes, I do. These files are loaded by container, with credentials and nodes essential folders.

print without node_modules

Hey @megarubber

Is that the contents of a docker volume or the contents of the local dev folder you have?

I will give it a quick bash in the morning and see if it is still working I made a forum post a while back on how to do it.

Well, I recreated the volume for container and it worked, following your tip :slight_smile:
Thanks for your help

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