A skeleton for getting started with a self-hosted n8n environment running in Docker Compose.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rob Colbert 8918649b36 added restart script to package.json 2 months ago
docker-caddy import docker setup from n8n-io/n8n-docker-caddy 1 year ago
docker-compose changes required for self-hosting n8n in a Docker Compose setup with DTP Newsroom support. 2 months ago
kubernetes import kubernetes setup from n8n-io/kubernetes-hosting 1 year ago
.gitignore configuring git and adding Node deps 2 months ago
README.md wip update to README to document external node module support and required environment settings 2 months ago
package.json added restart script to package.json 2 months ago
pnpm-lock.yaml lock file 2 months ago

README.md

n8n-hosting

This is a fork of the n8n-hosting GitHub project, and is a skeleton for building a Docke Compose environment for self-hosting an n8n instance in your environment to support the editor UI and worker nodes that run your jobs.

It has been specialized to expose ecosystem (NPM) modules and our custom code to an n8n environment. Our requirement for external modules and custom code in our workflows is what requires us (and you) to self-host n8n and run it in your environment.

Our Changes

Getting Started

  1. Clone dtp-n8n-hosting to a directory on your host/server.

And feel free to fork it. We are pulling updates from our upstream, and you can pull updates directly from them, or from us.

  1. Run npm install from the root of the project.

This will create your node_modules directory to receive external modules needed by DTP Newsroom.

  1. Customize .env
cd docker-compose/withPostgres
cp .env.example .env

You'll want to customize the values specified to match your requirements in your environment. This setup will run a PostgreSQL instance in a container, and directly access it

POSTGRES_USER=changeUser
POSTGRES_PASSWORD=changePassword
POSTGRES_DB=n8n

POSTGRES_NON_ROOT_USER=changeUser
POSTGRES_NON_ROOT_PASSWORD=changePassword
  1. Customize docker-compose.yml
environment:
  - WEBHOOK_URL=https://n8n.digitaltelepresence.com/
  - NODE_FUNCTION_ALLOW_BUILTIN=*
  - NODE_FUNCTION_ALLOW_EXTERNAL=dayjs,numeral
volumes:
  - /home/dtp/live/dtp-n8n-hosting/node_modules/dayjs:/usr/local/lib/node_modules/dayjs
  - /home/dtp/live/dtp-n8n-hosting/node_modules/numeral:/usr/local/lib/node_modules/numeral
  1. Run docker-compose up -d

  2. Visit http://localhost:5678/ to access n8n.

This will create a node_modules directory in the project directory. This is normal, and required. The directory will contain a subdirectory for each module added.