Install n8n and our community module using Docker. We provide installation examples for both Docker and Docker Compose. This setup includes the module from the start. You will not need to install CustomJS through the n8n UI; it's already part of the image.
Dockerfile
file and add the following content to it. This file tells Docker how to build your n8n image with the community node included:FROM n8nio/n8n:latest
USER root
RUN mkdir -p /home/node/.n8n/nodes
WORKDIR /home/node/.n8n/nodes
RUN npm install --omit=dev @custom-js/n8n-nodes-pdf-toolkit
RUN chown -R node:node /home/node/.n8n
USER node
docker-compose.yml
file in the same directory. This file defines the n8n service, its configuration, and the volume for persistent data:version: "3.8"
services:
n8n:
build: .
restart: always
ports:
- "5678:5678"
environment:
- NODE_ENV=production
- N8N_SECURE_COOKIE=false
- N8N_USER_EMAIL=admin@example.com
- N8N_USER_PASSWORD=supersecret
- N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
- DB_SQLITE_POOL_SIZE=5
- N8N_RUNNERS_ENABLED=true
- NODE_FUNCTION_ALLOW_EXTERNAL=*
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:
docker-compose up -d