Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

docs: add local development guidance for database webhooks (#34070)

Sean Wilson3ad076be1822
diff --git a/apps/docs/content/guides/database/webhooks.mdx b/apps/docs/content/guides/database/webhooks.mdx
index c4c9f84a9c3..92d58ff2fb8 100644
--- a/apps/docs/content/guides/database/webhooks.mdx
+++ b/apps/docs/content/guides/database/webhooks.mdx
@@ -80,6 +80,20 @@ type DeletePayload = {
Logging history of webhook calls is available under the `net` schema of your database. For more info, see the [GitHub Repo](https://github.com/supabase/pg_net).
+## Local development
+
+When using Database Webhooks on your local Supabase instance, you need to be aware that the Postgres database runs inside a Docker container. This means that `localhost` or `127.0.0.1` in your webhook URL will refer to the container itself, not your host machine where your application is running.
+
+To target services running on your host machine, use `host.docker.internal`. If that doesn't work, you may need to use your machine's local IP address instead.
+
+For example, if you want to trigger an edge function when a webhook fires, your webhook URL would be:
+
+```
+http://host.docker.internal:54321/functions/v1/my-function-name
+```
+
+If you're experiencing connection issues with webhooks locally, verify you're using the correct hostname instead of `localhost`.
+
## Resources
- [pg_net](/docs/guides/database/extensions/pgnet): an async networking extension for Postgres