diff --git a/n8n/README.md b/n8n/README.md index 8594c60..fbe7f83 100644 --- a/n8n/README.md +++ b/n8n/README.md @@ -5,22 +5,72 @@ Free and open fair-code licensed node based Workflow Automation Tool. ## Overview -Docker Hub Docs: https://hub.docker.com/r/n8nio/n8n#start-n8n-in-docker -Official docs docker-compose: https://docs.n8n.io/hosting/installation/server-setups/docker-compose/#5-create-docker-compose-file -Docker Hub Tags: https://hub.docker.com/r/n8nio/n8n/tags -Proxy Port: 5678 +Docker Compose setup for [n8n](https://n8n.io/), a workflow automation tool. -## Notes +## Project Details -There is a license key required, which is free at the time of writing. +- **Project Repository:** [n8n on GitHub](https://github.com/n8n-io/n8n) +- **Container Image:** [Docker Hub](https://hub.docker.com/r/n8nio/n8n) +- **Compose Example:** [n8n Docker Compose docs](https://docs.n8n.io/hosting/installation/server-setups/docker-compose/#5-create-docker-compose-file) +- **Documentation:** [n8n Docs](https://docs.n8n.io/) +- **Docker Hub Tags:** [Tags](https://hub.docker.com/r/n8nio/n8n/tags) +- **Reverse Proxy Port:** `5678` -### Setup +## Environment Variable Notes -You need to setup the data directory + N8N_IMAGE – Docker image tag (default: n8nio/n8n:latest) + N8N_PORT – Container port (default: 5678) + N8N_HOST – Hostname for the n8n instance (default: localhost) + N8N_PROTOCOL – Protocol (default: http; set to https behind NPM) + N8N_EDITOR_BASE_URL – Public-facing editor URL (default: http://localhost:5678) + N8N_SECURE_COOKIE – Set true when using HTTPS (default: true) + WEBHOOK_URL – Public-facing webhook URL (default: http://localhost:5678) -``` -mkdir -p data/n8n/ -chown -R 1000:1000 data/ -``` +## Reverse Proxy Setup (Nginx Proxy Manager) -When you load the page for the first time it will ask for an admin account. +1. In NPM, create a **Proxy Host**: + - **Domain Names:** `n8n.yourdomain.com` + - **Forward Hostname:** `n8n` + - **Forward Port:** `5678` + - **Scheme:** `http` + - **Websockets Support:** ✔ Enabled + - **Block Common Exploits:** ✔ Enabled + - **SSL:** ✔ Enable SSL (Let's Encrypt) + +2. Override these env vars: + + N8N_HOST=n8n.yourdomain.com + N8N_PROTOCOL=https + N8N_EDITOR_BASE_URL=https://n8n.yourdomain.com + WEBHOOK_URL=https://n8n.yourdomain.com + N8N_SECURE_COOKIE=true + +## Volume Notes + + ${VOL_PATH}/n8n/data – n8n database and config (chown 1000:1000) + ${VOL_PATH}/n8n/files – shared file storage for workflows + +## Network Notes + +Requires the external `proxy` network. + +## Additional Notes / Gotchas + +- A license key is required (free at the time of writing). +- First load will ask for an admin account. +- Setup data directory: + + mkdir -p data/n8n/ + chown -R 1000:1000 data/ + +## Dockhand Stack, Deploy from Git + +Cookbooks Repository + + stackname: n8n + Compose file path: n8n/compose.yaml + Additional env file (optional): n8n/sample.env + +Then "Load" n8n/sample.env into the Environmental variables in dockhand + +Create the Stack diff --git a/n8n/compose.yaml b/n8n/compose.yaml index 139c00b..552e3b5 100644 --- a/n8n/compose.yaml +++ b/n8n/compose.yaml @@ -16,6 +16,7 @@ services: - DB_SQLITE_VACUUM_ON_STARTUP=false - N8N_PORT=${N8N_PORT:-5678} - N8N_HOST=${N8N_HOST:-localhost} + - N8N_EDITOR_BASE_URL=${N8N_EDITOR_BASE_URL:-http://localhost:5678} - WEBHOOK_URL=${N8N_HOST:-http://localhost:5678} - N8N_SECURE_COOKIE=${N8N_SECURE_COOKIE:-true} - HOME=/home/node diff --git a/n8n/sample.env b/n8n/sample.env index 4785ddd..530b051 100644 --- a/n8n/sample.env +++ b/n8n/sample.env @@ -6,4 +6,12 @@ N8N_IMAGE=n8nio/n8n:latest # or 2.16.1 N8N_PORT=5678 N8N_HOST=localhost N8N_PROTOCOL=http -N8N_SECURE_COOKIE=true \ No newline at end of file +N8N_EDITOR_BASE_URL=http://localhost:5678 +N8N_SECURE_COOKIE=true + +# NPM Reverse Proxy (override these): +# N8N_HOST=n8n.yourdomain.com +# N8N_PROTOCOL=https +# N8N_EDITOR_BASE_URL=https://n8n.yourdomain.com +# WEBHOOK_URL=https://n8n.yourdomain.com +# N8N_SECURE_COOKIE=true \ No newline at end of file