Docker Setup

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.

  1. Create a 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
  1. Create a 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:
  1. Run the container:
docker-compose up -d
  1. You can now access CustomJS in n8n and add your API keys. For more information, see API Key.
    CustomJS n8n Module
    CustomJS n8n Module