Secret: Leave empty (or match Coolify’s secret if configured)
Trigger On: Select Push events
Click Add Webhook
Step 3: Secure Your Webhook with API Key (Recommended)
For secure webhook authentication between Forgejo and Coolify, configure a Bearer token. This prevents unauthorized webhook triggers.
Generating Coolify API Key
In Coolify, navigate to “Keys & Tokens”
Go to “API Tokens”
Click “New Token”
Fill in the Description
Check the permissions: “deploy” and “read”
Copy the generated token
Configuring Forgejo Webhook with Bearer Token
In Forgejo, go to your repository → Settings → Webhooks
Find your Coolify webhook and click Edit
Locate the Authorization Header field
Enter the Bearer token in this exact format:
Bearer <your-coolify-api-key>
Replace <your-coolify-api-key> with the actual token you copied from Coolify
Save the webhook
Security Benefits
Prevents unauthorized webhook triggers: Without authentication, anyone who discovers your webhook URL could trigger deployments
Ensures only Forgejo can trigger deployments: Coolify validates the Bearer token on every webhook request
Audit trail: You can trace which webhook triggered each deployment
Token rotation: If needed, you can revoke/regenerate the API key without changing the webhook URL
Step 4: The Critical Fix - Allowed Host List
By default, Forgejo blocks webhooks to private/internal IP addresses for security. This prevents Coolify webhooks from working if Coolify is on a private network.
The Error
You’ll see this in Forgejo’s webhook delivery logs:
Delivery: Post "http://10.x.x.x:8000/webhooks/...": not allowed to dial to '10.x.x.x'
The Solution
Add the FORGEJO__WEBHOOK__ALLOWED_HOST_LIST environment variable to your Forgejo deployment: