[GH-ISSUE #1303] Webhooks not triggering from docker container #365

Closed
opened 2026-02-26 18:46:41 +03:00 by kerem · 4 comments
Owner

Originally created by @van123helsing on GitHub (Aug 27, 2024).
Original GitHub issue: https://github.com/documenso/documenso/issues/1303

Issue Description

I ran the documenso as a docker container. I set up the webhooks to point to my NodeJS app on the host machine (not runing inside the docker container), but I have not been able to make it work.

Steps to Reproduce

I ran the docker image as:

docker run -d -p 3010:3010 
  -e PORT="3010" 
  -e NEXTAUTH_URL="http://localhost:3010"
  -e NEXTAUTH_SECRET="secret"
  -e NEXT_PRIVATE_ENCRYPTION_KEY=<encryption_key>
  -e NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=<encryption_key>
  -e NEXT_PUBLIC_WEBAPP_URL="http://localhost:3010"
  -e NEXT_PRIVATE_DATABASE_URL="postgres://postgres:postgres@pg-docker:5432/postgres"
  -e NEXT_PRIVATE_DIRECT_DATABASE_URL="postgres://postgres:postgres@pg-docker:5432/postgres"
  -e NEXT_PRIVATE_SMTP_TRANSPORT="smtp-api"
  -e NEXT_PRIVATE_SMTP_APIKEY_USER=<apikey>
  -e NEXT_PRIVATE_SMTP_APIKEY=<sendgrid_api_key>
  -e NEXT_PRIVATE_SMTP_FROM_NAME="Name"
  -e NEXT_PRIVATE_SMTP_HOST="smtp.sendgrid.net"
  -e NEXT_PRIVATE_SMTP_PORT="465"
  -e NEXT_PRIVATE_SMTP_SECURE="true"
  -e NEXT_PRIVATE_SMTP_FROM_ADDRESS="example@example.com"
  -e NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH="/opt/documenso/cert.p12"
  -e NEXT_PRIVATE_SIGNING_PASSPHRASE=""
  --network app-network
  --add-host=host.docker.internal:host-gateway 
 -v C:\certificate.p12:/opt/documenso/cert.p12 
 -d 
 documenso/documenso

The etc/hosts files has these entries:

127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
ff00::0	ip6-mcastprefix
ff02::1	ip6-allnodes
ff02::2	ip6-allrouters
192.168.65.254	host.docker.internal
172.21.0.3	b82c642041d9

I set up the webhooks like:

http://192.168.65.254:8000/webhook
http://host.docker.internal:8000/webhook

Expected Behavior

The webhook should be accessible on the URL I specified as webhooks. I did exec into the container and ran the curl command (POST) and it successfully invoked my app on the host machine on the 8000 port.

Current Behavior

There is no error in the documenco container, nor does the endpoint get triggered on the host app. I tried all trigger events: document.created, document.sent, document.opened, document..signed, document.completed

Screenshots (optional)

Posnetek zaslona 2024-08-27 110920

Operating System [e.g., Windows 10]

Windows 11 with docker + wsl

Browser [e.g., Chrome, Firefox]

No response

Version [e.g., 2.0.1]

latest

Please check the boxes that apply to this issue report.

  • I have searched the existing issues to make sure this is not a duplicate.
  • I have provided steps to reproduce the issue.
  • I have included relevant environment information.
  • I have included any relevant screenshots.
  • I understand that this is a voluntary contribution and that there is no guarantee of resolution.
  • I want to work on creating a PR for this issue if approved
Originally created by @van123helsing on GitHub (Aug 27, 2024). Original GitHub issue: https://github.com/documenso/documenso/issues/1303 ### Issue Description I ran the documenso as a docker container. I set up the webhooks to point to my NodeJS app on the host machine (not runing inside the docker container), but I have not been able to make it work. ### Steps to Reproduce I ran the docker image as: ``` docker run -d -p 3010:3010 -e PORT="3010" -e NEXTAUTH_URL="http://localhost:3010" -e NEXTAUTH_SECRET="secret" -e NEXT_PRIVATE_ENCRYPTION_KEY=<encryption_key> -e NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=<encryption_key> -e NEXT_PUBLIC_WEBAPP_URL="http://localhost:3010" -e NEXT_PRIVATE_DATABASE_URL="postgres://postgres:postgres@pg-docker:5432/postgres" -e NEXT_PRIVATE_DIRECT_DATABASE_URL="postgres://postgres:postgres@pg-docker:5432/postgres" -e NEXT_PRIVATE_SMTP_TRANSPORT="smtp-api" -e NEXT_PRIVATE_SMTP_APIKEY_USER=<apikey> -e NEXT_PRIVATE_SMTP_APIKEY=<sendgrid_api_key> -e NEXT_PRIVATE_SMTP_FROM_NAME="Name" -e NEXT_PRIVATE_SMTP_HOST="smtp.sendgrid.net" -e NEXT_PRIVATE_SMTP_PORT="465" -e NEXT_PRIVATE_SMTP_SECURE="true" -e NEXT_PRIVATE_SMTP_FROM_ADDRESS="example@example.com" -e NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH="/opt/documenso/cert.p12" -e NEXT_PRIVATE_SIGNING_PASSPHRASE="" --network app-network --add-host=host.docker.internal:host-gateway -v C:\certificate.p12:/opt/documenso/cert.p12 -d documenso/documenso ``` The `etc/hosts` files has these entries: ``` 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 192.168.65.254 host.docker.internal 172.21.0.3 b82c642041d9 ``` I set up the webhooks like: ``` http://192.168.65.254:8000/webhook http://host.docker.internal:8000/webhook ``` ### Expected Behavior The webhook should be accessible on the URL I specified as webhooks. I did `exec` into the container and ran the curl command (POST) and it successfully invoked my app on the host machine on the 8000 port. ### Current Behavior There is no error in the documenco container, nor does the endpoint get triggered on the host app. I tried all trigger events: document.created, document.sent, document.opened, document..signed, document.completed ### Screenshots (optional) ![Posnetek zaslona 2024-08-27 110920](https://github.com/user-attachments/assets/92891760-17fc-4049-a9e8-173fd07b78ba) ### Operating System [e.g., Windows 10] Windows 11 with docker + wsl ### Browser [e.g., Chrome, Firefox] _No response_ ### Version [e.g., 2.0.1] latest ### Please check the boxes that apply to this issue report. - [X] I have searched the existing issues to make sure this is not a duplicate. - [X] I have provided steps to reproduce the issue. - [X] I have included relevant environment information. - [X] I have included any relevant screenshots. - [X] I understand that this is a voluntary contribution and that there is no guarantee of resolution. - [ ] I want to work on creating a PR for this issue if approved
kerem 2026-02-26 18:46:41 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 27, 2024):

Thank you for opening your first issue and for being a part of the open signing revolution!

One of our team members will review it and get back to you as soon as it possible 💚

Meanwhile, please feel free to hop into our community in Discord

<!-- gh-comment-id:2311987647 --> @github-actions[bot] commented on GitHub (Aug 27, 2024): Thank you for opening your first issue and for being a part of the open signing revolution! <br /> One of our team members will review it and get back to you as soon as it possible 💚 <br /> Meanwhile, please feel free to hop into our community in [Discord](https://documen.so/discord)
Author
Owner

@ilmimris commented on GitHub (Mar 4, 2025):

I’ve encountered the same issue. Although there are no errors, the log shows the following webhook being sent:

Executing webhook 
   { 
           event: 'DOCUMENT_COMPLETED', 
           url: 'https://n8n.REDACTED/webhook/REDACTED' 
}

However, upon checking, there are no incoming webhooks configured in my n8n setup.

<!-- gh-comment-id:2696503888 --> @ilmimris commented on GitHub (Mar 4, 2025): I’ve encountered the same issue. Although there are no errors, the log shows the following webhook being sent: ``` Executing webhook { event: 'DOCUMENT_COMPLETED', url: 'https://n8n.REDACTED/webhook/REDACTED' } ``` However, upon checking, there are no incoming webhooks configured in my n8n setup.
Author
Owner

@ephraimduncan commented on GitHub (Aug 23, 2025):

The issue is that the Docker container needs the NEXT_PRIVATE_INTERNAL_WEBAPP_URL environment variable set correctly for internal API calls. Add this to your Docker run command:

-e NEXT_PRIVATE_INTERNAL_WEBAPP_URL="http://localhost:3010"

The webhook system makes internal API calls first before executing external webhooks. Without NEXT_PRIVATE_INTERNAL_WEBAPP_URL, it defaults to the public URL which may not be accessible from within the container. Setting this explicitly ensures the internal API communication works correctly.

<!-- gh-comment-id:3216251724 --> @ephraimduncan commented on GitHub (Aug 23, 2025): The issue is that the Docker container needs the `NEXT_PRIVATE_INTERNAL_WEBAPP_URL` environment variable set correctly for internal API calls. Add this to your Docker run command: ``` -e NEXT_PRIVATE_INTERNAL_WEBAPP_URL="http://localhost:3010" ``` The webhook system makes internal API calls first before executing external webhooks. Without `NEXT_PRIVATE_INTERNAL_WEBAPP_URL`, it defaults to the public URL which may not be accessible from within the container. Setting this explicitly ensures the internal API communication works correctly.
Author
Owner

@kamasuPaul commented on GitHub (Aug 27, 2025):

-e NEXT_PRIVATE_INTERNAL_WEBAPP_URL="http://localhost:3010"

NEXT_PRIVATE_INTERNAL_WEBAPP_URL="http://localhost:3000"
Don't forget to change the port, it's 3000 for the default deployment

<!-- gh-comment-id:3226649187 --> @kamasuPaul commented on GitHub (Aug 27, 2025): > ``` > -e NEXT_PRIVATE_INTERNAL_WEBAPP_URL="http://localhost:3010" > ``` > NEXT_PRIVATE_INTERNAL_WEBAPP_URL="http://localhost:3000" Don't forget to change the port, it's `3000 ` for the default deployment
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#365
No description provided.