Stuck at initialization for self hosted version when using port 80

N8n is stuck at initialization whenever I’m trying to use port 80 for a self hosted version

The issue

Everything runs locally when using docker-compose. Everything runs on AWS ECS using the default port 5678 as well, but when change the N8N_PORT to 80, the container just fails to initialize. I tried enabling the debug logs, but unfortunately they were of no help.

Information on your n8n setup

  • n8n version: latest
  • Database: Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): AWS ECS/Docker
  • Operating system: Amazon Linux 2023 (ARM64)

Env variables used:

  • GENERIC_TIMEZONE=Europe/Berlin
  • TZ=Europe/Berlin
  • DB_TYPE=postgresdb
  • DB_POSTGRESDB_DATABASE=n8n
  • DB_POSTGRESDB_HOST=some_host.aws.com
  • DB_POSTGRESDB_PORT=5432
  • DB_POSTGRESDB_USER=my_db_username
  • DB_POSTGRESDB_PASSWORD=my_db_password
  • DB_POSTGRESDB_SCHEMA=public
  • DB_POSTGRESDB_SSL_ENABLED=true
  • DB_POSTGRESDB_SSL_CA=my_db_ca
  • DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED=true
  • N8N_ENCRYPTION_KEY=my_n8n_encryption_key
  • N8N_EDITOR_BASE_URL=https://n8n.mydomain.com
  • N8N_HOST=n8n.mydomain.com
  • N8N_PORT=80
  • N8N_LOG_LEVEL=debug
  • DEBUG=*

Logs from AWS ECS Task:

timestamp,message
1739217942311,2025-02-10T20:05:42.309Z oclif:main process.execPath: /usr/local/bin/node
1739217942311,2025-02-10T20:05:42.311Z oclif:main process.execArgv: 
1739217942313,"2025-02-10T20:05:42.313Z oclif:main process.argv: [ '/usr/local/bin/node', '/usr/local/bin/n8n', 'start' ]"
1739217942314,2025-02-10T20:05:42.314Z oclif:find-root:root-plugin Finding root plugin using /usr/local/lib/node_modules/n8n/bin
1739217942314,2025-02-10T20:05:42.314Z oclif:find-root:root-plugin Finding root starting at /usr/local/lib/node_modules/n8n/bin
1739217942314,2025-02-10T20:05:42.314Z oclif:find-root:root-plugin Checking /usr/local/lib/node_modules/n8n/bin/package.json
1739217942315,2025-02-10T20:05:42.315Z oclif:find-root:root-plugin Checking /usr/local/lib/node_modules/n8n/package.json
1739217942317,2025-02-10T20:05:42.317Z oclif:find-root:root-plugin Found root by traversing up from starting point!
1739217942317,2025-02-10T20:05:42.317Z oclif:find-root:root-plugin Found root at /usr/local/lib/node_modules/n8n
1739217942317,2025-02-10T20:05:42.317Z oclif:config loading core plugin from /usr/local/lib/node_modules/n8n
1739217942318,2025-02-10T20:05:42.318Z oclif:read-pjson found oclif config in /usr/local/lib/node_modules/n8n/package.json
1739217942318,2025-02-10T20:05:42.318Z oclif:config:n8n command discovery options {
1739217942318,  globPatterns: [
1739217942318,"    '**/*.+(js|cjs|mjs|ts|tsx|mts|cts)',"
1739217942318,    '!**/*.+(d.ts|test.ts|test.js|spec.ts|spec.js|d.mts|d.cts)?(x)'
1739217942318,"  ],"
1739217942318,"  strategy: 'pattern',"
1739217942318,  target: './dist/commands'
1739217942318,}
1739217942320,"2025-02-10T20:05:42.320Z oclif:config:ts-path Skipping typescript path lookup for /usr/local/lib/node_modules/n8n because NODE_ENV is NOT ""test"" or ""development"""
1739217942320,2025-02-10T20:05:42.320Z oclif:config:n8n loading IDs from /usr/local/lib/node_modules/n8n/dist/commands
1739217942347,2025-02-10T20:05:42.346Z oclif:config:n8n found commands [
1739217942347,"  'audit',                 'base-command',"
1739217942347,"  'execute-batch',         'execute',"
1739217942347,"  'start',                 'webhook',"
1739217942347,"  'worker',                'db:revert',"
1739217942347,"  'export:credentials',    'export:workflow',"
1739217942347,"  'import:credentials',    'import:workflow',"
1739217942347,"  'ldap:reset',            'license:clear',"
1739217942347,"  'license:info',          'list:workflow',"
1739217942347,"  'mfa:disable',           'update:workflow',"
1739217942347,  'user-management:reset'
1739217942347,]
1739217943813,"2025-02-10T20:05:43.812Z | e[33mwarne[39m | e[33mPermissions 0644 for n8n settings file /home/node/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.e[39m {""file"":""instance-settings.js"",""function"":""ensureSettingsFilePermissions""}"
1739217945354,2025-02-10T20:05:45.353Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/audit.js
1739217945354,2025-02-10T20:05:45.354Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/base-command.js
1739217945354,2025-02-10T20:05:45.354Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/execute-batch.js
1739217945355,2025-02-10T20:05:45.355Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/execute.js
1739217945355,2025-02-10T20:05:45.355Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/start.js
1739217945355,2025-02-10T20:05:45.355Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/webhook.js
1739217945355,2025-02-10T20:05:45.355Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/worker.js
1739217945355,2025-02-10T20:05:45.355Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/db/revert.js
1739217945355,2025-02-10T20:05:45.355Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/export/credentials.js
1739217945356,2025-02-10T20:05:45.355Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/export/workflow.js
1739217945356,2025-02-10T20:05:45.356Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/import/credentials.js
1739217945356,2025-02-10T20:05:45.356Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/import/workflow.js
1739217945356,2025-02-10T20:05:45.356Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/ldap/reset.js
1739217945356,2025-02-10T20:05:45.356Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/license/clear.js
1739217945356,2025-02-10T20:05:45.356Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/license/info.js
1739217945356,2025-02-10T20:05:45.356Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/list/workflow.js
1739217945356,2025-02-10T20:05:45.356Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/mfa/disable.js
1739217945357,2025-02-10T20:05:45.356Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/update/workflow.js
1739217945357,2025-02-10T20:05:45.357Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/user-management/reset.js
1739217945476,2025-02-10T20:05:45.476Z oclif:config reading user plugins pjson /home/node/.local/share/n8n/package.json
1739217945480,2025-02-10T20:05:45.480Z oclif:config config done
1739217945481,2025-02-10T20:05:45.481Z oclif:config start init hook
1739217945482,2025-02-10T20:05:45.481Z oclif:config init hook done
1739217945482,2025-02-10T20:05:45.482Z oclif:config runCommand start []
1739217945483,2025-02-10T20:05:45.483Z oclif:config:n8n (require) /usr/local/lib/node_modules/n8n/dist/commands/start.js
1739217945483,2025-02-10T20:05:45.483Z oclif:config start prerun hook
1739217945483,2025-02-10T20:05:45.483Z oclif:config prerun hook done
1739217945493,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""x-powered-by"" to true"
1739217945541,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""etag"" to 'weak'"
1739217945542,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""etag fn"" to [Function: generateETag]"
1739217945542,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""env"" to 'production'"
1739217945542,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""query parser"" to 'extended'"
1739217945543,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""query parser fn"" to [Function: parseExtendedQueryString]"
1739217945543,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""subdomain offset"" to 2"
1739217945543,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""trust proxy"" to false"
1739217945544,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""trust proxy fn"" to [Function: trustNone]"
1739217945544,"Mon, 10 Feb 2025 20:05:45 GMT express:application booting in production mode"
1739217945544,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""view"" to [Function: View]"
1739217945544,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""views"" to '/home/node/views'"
1739217945545,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""jsonp callback name"" to 'callback'"
1739217945545,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""view cache"" to true"
1739217945545,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""x-powered-by"" to false"
1739217945546,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""view engine"" to 'handlebars'"
1739217945546,"Mon, 10 Feb 2025 20:05:45 GMT express:application set ""views"" to '/usr/local/lib/node_modules/n8n/templates'"
1739217945550,"2025-02-10T20:05:45.549Z | e[32minfoe[39m | e[32mInitializing n8n processe[39m {""file"":""start.js"",""function"":""init""}"
1739217945550,2025-02-10T20:05:45.550Z oclif:config start preparse hook
1739217945550,2025-02-10T20:05:45.550Z oclif:config preparse hook done
1739217945730,"2025-02-10T20:05:45.730Z | e[34mdebuge[39m | e[34mLazy-loading nodes and credentials from n8n-nodes-basee[39m {""nodes"":468,""credentials"":375,""file"":""lazy-package-directory-loader.js"",""function"":""loadAll""}"
1739217945743,"2025-02-10T20:05:45.743Z | e[34mdebuge[39m | e[34mLazy-loading nodes and credentials from @n8n/n8n-nodes-langchaine[39m {""nodes"":81,""credentials"":17,""file"":""lazy-package-directory-loader.js"",""function"":""loadAll""}"

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
  • n8n version: latest
  • Database: Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): AWS ECS/Docker
  • Operating system: Amazon Linux 2023 (ARM64)

Probably a combination of this and whether or not the container is running with root user privileges, i.e. both root user (0) within the container, and containerization (Docker) running as root to bind to port 80 on the container host.

It is typically easier to just keep the non-privileged port 5678 on the n8n process, and have something else (load balancer, reverse proxy, ingress) receive traffic on a privileged port (80, 443) and forward to n8n.

1 Like

Thank you for the response. In the end, I kept n8n running on the default port 5678 and had my load balancer forward traffic from port 443 to n8n

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.