Private nodes with docker

Describe the problem/error/question

I try to install a private node using Docker. I install the node deps, built it and link to ~/.n8n/custom directory but I can’t see the new node and I don’t have any error.

According to many posts I read (like this), I understand that I’m doing everything right but I can’t find the new component.

Please share your workflow

# Dockerfile
ARG NODE_VERSION=20

# Build the custom n8n nodes
FROM --platform=linux/amd64 node:${NODE_VERSION}-alpine as builder
WORKDIR /tmp

# Get the sample node starter repo and install it
RUN apk update \
    && apk add git \
    && cd /tmp \
    && git clone https://github.com/n8n-io/n8n-nodes-starter.git \
    && cd n8n-nodes-starter \
    && sed -i 's/"name": "n8n-nodes-<...>"/"name": "n8n-nodes-starter"/' package.json \
    && npm install \
    && npm run build

FROM n8nio/n8n:1.47.2 as runner

COPY --from=builder /tmp/n8n-nodes-starter/. /n8n-nodes-starter/

USER root

RUN cd /n8n-nodes-starter \
    && npm link \
    && cd /home/node/.n8n \
    && mkdir custom \
    && cd custom \
    && npm init -y \
    && npm link n8n-nodes-starter \
    && chown -R node:node /home/node/.n8n/*

USER node
# docker-compose.yml

volumes:
  db_storage:
  n8n_storage:

services:
  n8n:
    build:
      context: n8n
    environment:
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_USER=${POSTGRES_USER}
      - DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}
      - DB_POSTGRESDB_DATABASE=n8n
      - N8N_PERSONALIZATION_ENABLED=false
    ports:
      - 5678:5678

  postgres:
    image: postgres:16.3
    environment:
      - POSTGRES_USER=${POSTGRES_USER}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
      - POSTGRES_DB=n8n
    volumes:
      - db_storage:/var/lib/postgresql/data

Information on your n8n setup

  • n8n version: 1.47.2
  • Database (default: SQLite): PostgresSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: MacOS

Hey @franco,

Welcome to the community :tada:

When building your image does it show any issues, Do you also see the node in the correct directory when the container is running?