Migrated sqlite database to new server will not apply .env webhook URLS

This took me a while to figure out but on my migrated database, when i set the following in my .env file:

N8N_HOST=automation.MYDOMAINHERE.com
N8N_WEBHOOK=automation.MYDOMAINHERE.com
N8N_WEBHOOK_URL=https://automation.MYDOMAINHERE.com
WEBHOOK_URL=https://automation.MYDOMAINHERE.com
N8N_EDITOR_BASE_URL=https://automation.MYDOMAINHERE.com
N8N_PROTOCOL=https
N8N_PORT=5678
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=admin
N8N_BASIC_AUTH_PASSWORD=MYPASSWORDHERE$
N8N_SECURE_COOKIE=false
N8N_ENV=production
N8N_LOG_LEVEL=debug
N8N_LOG_OUTPUT=console,file

Debug info

core

  • n8nVersion: 2.18.4

  • platform: docker (self-hosted)

  • nodeJsVersion: 24.14.1

  • nodeEnv: production

  • database: sqlite

  • executionMode: regular

  • concurrency: -1

  • license: community

  • consumerId: unknown

storage

  • success: all

  • error: all

  • progress: false

  • manual: true

  • binaryMode: filesystem

pruning

  • enabled: true

  • maxAge: 336 hours

  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/147.0.0.0 safari/537.36

  • isTouchDevice: false

security

  • secureCookie: false

Generated at: 2026-04-30T04:29:24.861Z

Operating System

linux debian

n8n Version

see above

Node.js Version

see above

Database

SQLite (default)

Execution mode

main (default)

Hosting

n8n cloud

Sent you a dm btw.

嗨 @Nicolas_Zein,除了 @Miliaga 提到的 N8N_WEBHOOK 不是真實變數之外,你的 env 檔案中每個 = 後面還有一個前導空格(N8N_HOST= automation...)— docker 會把這個空格當作值的一部分,所以 N8N_HOST 變成 automation.MYDOMAINHERE.com,URL 永遠無法匹配。刪除每個 = 後面的空格。快速測試工作流以確認修復後 webhook 解析到你的網域:

匯入、啟動,點擊 /webhook/test-url — 現在節點面板中顯示的生產 URL 應該會以 https://automation.yourdomain.com 開頭。

@achamm 嘿夥計,你在哪裡看到空格?

這是因為論壇最初的渲染方式,只要確保你的 env 檔案格式正確就可以了!這樣應該就能正常運作了!