n8n - WEBHOOK_URL Support #539

Closed
opened 2026-02-04 19:42:12 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @sicrob007 on GitHub (Feb 22, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

n8n

📂 What was the exact command used to execute the script?

bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/n8n.sh)"

📝 Provide a clear and concise description of the issue.

Webhooks are not supported given there is no ability to modify the webhook URL within settings for n8n. This issue impacts the ability to implement any integration that requires OAuth as it defaults to a http://localhost:5678/ address for all callbacks. Suggest the ability to implement a WEBHOOK_URL during the installation allowing for user to specify their intended reverse proxy address or other during the installation process.

Documentation related to the Docker Environment Variable is available at the following URL:
https://docs.n8n.io/hosting/configuration/configuration-examples/webhook-url/

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

🔄 Steps to reproduce the issue.

  1. Run the installation script.
  2. set up reverse proxy or use an assigned IP address from Proxmox to login to n8n instance.
  3. Attempt to set any credential (integration) that requires OAuth to authorize.
  4. Callback URL (WEBHOOK_URL) is hardcoded on the page to allow you to copy and paste for the redirect URL.

Paste the full error output (if available).

See above to replicate issue. No error message, except that the WEBHOOK_URL is not supported with the LXC Container installation.

🖼️ Additional context (optional).

No response

Originally created by @sicrob007 on GitHub (Feb 22, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? n8n ### 📂 What was the exact command used to execute the script? bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/n8n.sh)" ### 📝 Provide a clear and concise description of the issue. Webhooks are not supported given there is no ability to modify the webhook URL within settings for n8n. This issue impacts the ability to implement any integration that requires OAuth as it defaults to a http://localhost:5678/ address for all callbacks. Suggest the ability to implement a WEBHOOK_URL during the installation allowing for user to specify their intended reverse proxy address or other during the installation process. Documentation related to the Docker Environment Variable is available at the following URL: https://docs.n8n.io/hosting/configuration/configuration-examples/webhook-url/ ### ⚙️ What settings are you using? - [x] Default Settings - [x] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 🔄 Steps to reproduce the issue. 1. Run the installation script. 2. set up reverse proxy or use an assigned IP address from Proxmox to login to n8n instance. 3. Attempt to set any credential (integration) that requires OAuth to authorize. 4. Callback URL (WEBHOOK_URL) is hardcoded on the page to allow you to copy and paste for the redirect URL. ### ❌ Paste the full error output (if available). See above to replicate issue. No error message, except that the WEBHOOK_URL is not supported with the LXC Container installation. ### 🖼️ Additional context (optional). _No response_
OVERLORD added the feature label 2026-02-04 19:42:12 +03:00
Author
Owner

@michelroegl-brunner commented on GitHub (Feb 28, 2025):

Nothing we can do in the script. You need to edit the service file and restart the service:

nano /etc/systemd/system/n8n.service

Add Environment="N8N_SECURE_COOKIE=false" and Environment="N8N_EDITOR_BASE_URL=example.com" to the file. Replace example.com with your domain.

[Unit]
Description=n8n

[Service]
Type=simple
Environment="N8N_SECURE_COOKIE=false"
Environment="N8N_EDITOR_BASE_URL=example.com"
Environment="WEBHOOK_URL=example.com"
ExecStart=n8n start
[Install]
WantedBy=multi-user.target

reload demaon systemctl daemon-reload

restart service systemctl restart n8n

Image

@michelroegl-brunner commented on GitHub (Feb 28, 2025): Nothing we can do in the script. You need to edit the service file and restart the service: `nano /etc/systemd/system/n8n.service` Add `Environment="N8N_SECURE_COOKIE=false"` and `Environment="N8N_EDITOR_BASE_URL=example.com"` to the file. Replace example.com with your domain. ```bash [Unit] Description=n8n [Service] Type=simple Environment="N8N_SECURE_COOKIE=false" Environment="N8N_EDITOR_BASE_URL=example.com" Environment="WEBHOOK_URL=example.com" ExecStart=n8n start [Install] WantedBy=multi-user.target ``` reload demaon `systemctl daemon-reload` restart service `systemctl restart n8n` ![Image](https://github.com/user-attachments/assets/122bb046-6120-4c11-9c09-f17b84d14979)
Author
Owner

@Ede1994 commented on GitHub (Feb 28, 2025):

I'm new in this field and have installed n8n via the helper scripts on proxmox. I have also changed the n8n.service to:

[Unit]
Description=n8n

[Service]
Type=simple
Environment="N8N_SECURE_COOKIE=false"
Environment="N8N_EDITOR_BASE_URL=192.xxx.xxx.xx" <-- n8n ip address
Environment="WEBHOOK_URL=192.xxx.xxx.xx:5678"
ExecStart=n8n start
[Install]
WantedBy=multi-user.target

And get the error: Bad Request: bad webhook: Webhook can be set up only on ports 80, 88, 443 or 8443.

Can you please explain me this? Thx :)

@Ede1994 commented on GitHub (Feb 28, 2025): I'm new in this field and have installed n8n via the helper scripts on proxmox. I have also changed the n8n.service to: ```bash [Unit] Description=n8n [Service] Type=simple Environment="N8N_SECURE_COOKIE=false" Environment="N8N_EDITOR_BASE_URL=192.xxx.xxx.xx" <-- n8n ip address Environment="WEBHOOK_URL=192.xxx.xxx.xx:5678" ExecStart=n8n start [Install] WantedBy=multi-user.target ``` And get the error: Bad Request: bad webhook: Webhook can be set up only on ports 80, 88, 443 or 8443. Can you please explain me this? Thx :)
Author
Owner

@LogicBypass commented on GitHub (Mar 29, 2025):

I'm new in this field and have installed n8n via the helper scripts on proxmox. I have also changed the n8n.service to:

[Unit]
Description=n8n

[Service]
Type=simple
Environment="N8N_SECURE_COOKIE=false"
Environment="N8N_EDITOR_BASE_URL=192.xxx.xxx.xx" <-- n8n ip address
Environment="WEBHOOK_URL=192.xxx.xxx.xx:5678"
ExecStart=n8n start
[Install]
WantedBy=multi-user.target
And get the error: Bad Request: bad webhook: Webhook can be set up only on ports 80, 88, 443 or 8443.

Can you please explain me this? Thx :)

@Ede1994
You need to create a tunnel to expose your service externally to the internet.

  • Create CloudFlare account
  • Go to: Cloudflare > Zero Trust > Networks > Tunnels
  • Connector: cloudflared
  • Install it on your container.

Create a route.

  • Go to: Cloudflare > Zero Trust > Networks > Tunnels
  • Click your tunnel (n8n)
  • Click Configure → Public Hostname → Add
Subdomain: n8n
Domain: select from available
Path: /
Service: http://localhost:5678

Configure n8n as a systemd service

sudo nano /etc/systemd/system/n8n.service

[Unit]
Description=n8n

[Service]
Type=simple
Environment="N8N_SECURE_COOKIE=false"
Environment="N8N_EDITOR_BASE_URL=https://n8n.yourcloudflareaddress"
Environment="WEBHOOK_URL=https://n8n.yourcloudflareaddress"
ExecStart=n8n start

[Install]
WantedBy=multi-user.target

reload demaon systemctl daemon-reload
restart service systemctl restart n8n

It should work, but recommended to secure your service as is accessible from the internet

  • Go to: Cloudflare > Zero Trust > Access > Applications
  • Click Add an application
  • Select type: Self-hosted
    Fill in:
  • Application name: n8n
  • Domain: https://thesamedomainasprevious
  • Session duration: 24 hours (or less)

Create an Allow policy:

  • Action: Allow
  • Include: Email, enter your email, or use One-Time PIN
  • Finish setup

Important step!!! Allow public access to the OAuth callback path:

  • Go to: Cloudflare > Zero Trust > Access > Applications and create new application
  • Click Add an application
  • Select type: Self-hosted
    Fill in:
Application name: n8n-oauth-callback
Domain: selectyourdomain
Path: /rest/oauth2-credential/callback*
Session duration: 24 hours
  • Create a Bypass policy:
  • New policy:
    Action: Bypass
    Include: Everyone
  • Finish setup

Final test:
When opening your website n8n.example.com you need to be prompted with an email.
When opening n8n.example.com/rest/oauth2-credential/callback you need to get to the page without being prompted for email.

@LogicBypass commented on GitHub (Mar 29, 2025): > I'm new in this field and have installed n8n via the helper scripts on proxmox. I have also changed the n8n.service to: > > [Unit] > Description=n8n > > [Service] > Type=simple > Environment="N8N_SECURE_COOKIE=false" > Environment="N8N_EDITOR_BASE_URL=192.xxx.xxx.xx" <-- n8n ip address > Environment="WEBHOOK_URL=192.xxx.xxx.xx:5678" > ExecStart=n8n start > [Install] > WantedBy=multi-user.target > And get the error: Bad Request: bad webhook: Webhook can be set up only on ports 80, 88, 443 or 8443. > > Can you please explain me this? Thx :) @Ede1994 You need to create a tunnel to expose your service externally to the internet. - Create CloudFlare account - Go to: `Cloudflare > Zero Trust > Networks > Tunnels` - **Connector**: `cloudflared` - Install it on your container. Create a route. - Go to: Cloudflare > Zero Trust > Networks > Tunnels - Click your tunnel (n8n) - Click Configure → Public Hostname → Add ``` Subdomain: n8n Domain: select from available Path: / Service: http://localhost:5678 ``` Configure n8n as a systemd service `sudo nano /etc/systemd/system/n8n.service` ``` [Unit] Description=n8n [Service] Type=simple Environment="N8N_SECURE_COOKIE=false" Environment="N8N_EDITOR_BASE_URL=https://n8n.yourcloudflareaddress" Environment="WEBHOOK_URL=https://n8n.yourcloudflareaddress" ExecStart=n8n start [Install] WantedBy=multi-user.target ``` reload demaon `systemctl daemon-reload` restart service `systemctl restart n8n` It should work, but recommended to secure your service as is accessible from the internet - Go to: Cloudflare > Zero Trust > Access > Applications - Click Add an application - Select type: Self-hosted Fill in: - Application name: n8n - Domain: https://thesamedomainasprevious - Session duration: 24 hours (or less) Create an Allow policy: - Action: Allow - Include: Email, enter your email, or use One-Time PIN - Finish setup Important step!!! Allow public access to the OAuth callback path: - Go to: Cloudflare > Zero Trust > Access > Applications and create new application - Click Add an application - Select type: Self-hosted Fill in: ``` Application name: n8n-oauth-callback Domain: selectyourdomain Path: /rest/oauth2-credential/callback* Session duration: 24 hours ``` - Create a Bypass policy: - New policy: Action: Bypass Include: Everyone - Finish setup Final test: When opening your website n8n.example.com you need to be prompted with an email. When opening n8n.example.com/rest/oauth2-credential/callback you need to get to the page without being prompted for email.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#539