Static IP for Supabase
One dedicated IPv4 handles both sides of Supabase networking: outbound calls from Edge Functions and access to a locked-down Postgres database.
First payment refunded within 7 days if it doesn’t work for you
- Partner API
On this page14
Inside Deno-based Edge Functions, outbound requests go through a Relay URL with standard fetch(), or through Deno.createHttpClient when you need multiple hosts or mTLS. To reach Supabase Postgres behind Network Restrictions from external apps, CI migrations, or psql, connect via prontaro forward or SOCKS5.
Which method to choose
| Scenario | Prontaro method | Best for |
|---|---|---|
| Part 1. Edge Functions → partner REST API | Relay URL (recommended) | Standard fetch() — no custom proxy client setup in Deno |
| Part 1. Edge Functions → multiple hosts or mTLS | HTTPS proxy (Deno.createHttpClient) |
End-to-end TLS via HTTP CONNECT to any allowed host |
Part 2. External app / CI / psql → Supabase Postgres |
prontaro forward or socks5h:// |
Connects to PostgreSQL from your allowlisted static IPv4 |
A Relay URL decrypts TLS on the Prontaro server and opens a new HTTPS connection to the target API. Use HTTPS proxy when a partner requires end-to-end TLS or mTLS — see Relay URLs.
Prerequisites
- A Prontaro account on Dedicated or Pro (plans). After subscribing, open my.prontaro.com/ips, pick a location near your Supabase project’s region, and click Add IP.
- A Supabase project. Part 2 (Network Restrictions) requires the Supabase Pro plan or higher (not available on Supabase Free).
- No
prontaro CLIis needed for Part 1: create Relay URLs or proxy credentials in the dashboard. LocalsupabaseCLI is also optional — manage secrets and functions in the Supabase Dashboard.
Part 1. Outbound static IP for Supabase Edge Functions
Step 1. Create a Relay URL (recommended)
Add your dedicated IPv4 (/32) to the partner API’s allowlist, then create a Relay for its hostname in the dashboard:
- Open IP addresses in my.prontaro.com, select your IP, and click Add relay address.
- Enter
api.example.comand copy the generated URL (https://relay-3f9c2a7e-5b1d-4c8a-9e60-1d2b3c4d5e6f.prontaro.run).
Step 2. Store the secrets in Supabase
Add the secrets in the Supabase Dashboard:
- PRONTARO_RELAY_URL
- https://relay-3f9c2a7e-5b1d-4c8a-9e60-1d2b3c4d5e6f.prontaro.run
- PARTNER_API_TOKEN
- your-partner-token
Or with the Supabase CLI (supabase secrets set applies to hosted Edge Functions immediately with no redeploy required):
supabase secrets set PRONTARO_RELAY_URL="https://relay-3f9c2a7e-5b1d-4c8a-9e60-1d2b3c4d5e6f.prontaro.run"
supabase secrets set PARTNER_API_TOKEN="your-partner-token"Step 3. Call the Relay URL from your Edge Function
Use standard fetch() in Deno:
// supabase/functions/partner-call/index.ts
Deno.serve(async (req) => {
const relayBase = Deno.env.get('PRONTARO_RELAY_URL');
const token = Deno.env.get('PARTNER_API_TOKEN');
if (!relayBase || !token) {
return Response.json(
{ error: 'Missing PRONTARO_RELAY_URL or PARTNER_API_TOKEN' },
{ status: 500 },
);
}
const targetUrl = new URL('/v1/status', relayBase);
const upstream = await fetch(targetUrl, {
method: req.method === 'POST' ? 'POST' : 'GET',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: req.method === 'POST' ? await req.text() : undefined,
signal: AbortSignal.timeout(15_000),
});
return new Response(await upstream.text(), {
status: upstream.status,
headers: {
'content-type': upstream.headers.get('content-type') ?? 'application/json',
},
});
});Deploy via the Dashboard or supabase functions deploy partner-call.
Step 4. Verify the Edge Function IP
- Create a temporary Relay for
api.ipify.orgin the dashboard and store it in a secret namedPRONTARO_TEST_RELAY_URL. - Deploy a temporary
egress-checkfunction that calls the root of that Relay URL (do not pointpartner-callatapi.ipify.org, because/v1/statusreturns404):
// supabase/functions/egress-check/index.ts (remove after verifying)
Deno.serve(async () => {
const res = await fetch(Deno.env.get('PRONTARO_TEST_RELAY_URL')!, {
signal: AbortSignal.timeout(10_000),
});
return new Response((await res.text()).trim(), { status: res.status });
});- Copy your project’s
anonkey from Project Settings → API and call the function:
curl -fsS "https://<project-ref>.supabase.co/functions/v1/egress-check" -H "Authorization: Bearer $SUPABASE_ANON_KEY"
203.0.113.10After confirming the IP, delete the temporary egress-check function and temporary Relay in the dashboard.
Alternative: HTTP proxy via Deno.createHttpClient
If you need end-to-end TLS via HTTP CONNECT or calls to multiple hosts from one function, create proxy credentials in the dashboard (IP addresses → Proxy credentials).
Save https://u_edge:s3cr3t@<entry>.prontaro.io:443 in PRONTARO_PROXY_URL and reuse a module-level client:
// supabase/functions/partner-proxy/index.ts
const rawProxyUrl = Deno.env.get('PRONTARO_PROXY_URL');
const httpClient = rawProxyUrl
? (() => {
const u = new URL(rawProxyUrl);
return Deno.createHttpClient({
proxy: {
url: `${u.protocol}//${u.host}`,
basicAuth: {
username: decodeURIComponent(u.username),
password: decodeURIComponent(u.password),
},
},
});
})()
: null;
Deno.serve(async () => {
if (!httpClient) {
return Response.json({ error: 'PRONTARO_PROXY_URL is not set' }, { status: 500 });
}
const upstream = await fetch('https://api.example.com/v1/status', {
client: httpClient,
headers: { Authorization: `Bearer ${Deno.env.get('PARTNER_API_TOKEN')}` },
signal: AbortSignal.timeout(15_000),
});
return new Response(await upstream.text(), {
status: upstream.status,
headers: { 'content-type': upstream.headers.get('content-type') ?? 'application/json' },
});
});Once verified against https://api.ipify.org, lock the To list in the credentials’ Access tab down to api.example.com:443.
Part 2. Connect to Supabase Postgres with Network Restrictions
When Network Restrictions (Supabase Pro and higher) are enabled, only allowlisted CIDRs can reach Postgres.
Step 1. Add your static IP to Network Restrictions
- IPv4 CIDR
- 203.0.113.10/32
Step 2. Copy the Supavisor host and start port forwarding
From Connect, copy the Supavisor Session pooler host and port (for example, aws-0-eu-central-1.pooler.supabase.com:5432).
- Why the Supavisor pooler: direct
db.<ref>.supabase.cohosts are IPv6-only without Supabase’s Dedicated IPv4 add-on.*.pooler.supabase.comresolves to IPv4 and works straight through your Prontaro IPv4.
Start prontaro forward to that host:
prontaro forward 15432 aws-0-eu-central-1.pooler.supabase.com:5432 --ip 203.0.113.10prontaro forward 15432 aws-0-eu-central-1.pooler.supabase.com:5432
127.0.0.1:15432 → aws-0-eu-central-1.pooler.supabase.com:5432 from your IP 203.0.113.10Step 3. Connect with psql and verify access
Pass your database password via PGPASSWORD (or enter it when prompted) and run a test query against 127.0.0.1:15432:
PGPASSWORD="$SUPABASE_DB_PASSWORD" psql "postgresql://postgres.<project-ref>@127.0.0.1:15432/postgres?sslmode=require" -c "SELECT 1;"
?column?
----------
1
(1 row)For apps with native SOCKS5 support, connect using socks5h://, verify the IP against api.ipify.org, and then restrict the To list to *.pooler.supabase.com:5432 in the dashboard.
Common errors
| Error | Cause | Fix |
|---|---|---|
Local supabase functions serve cannot read secrets |
supabase secrets set only updates the hosted project. |
Pass --env-file .env.local locally and keep .env.local out of Git. |
Connection error or IPv6 failure on db.<ref>.supabase.co:5432 |
Direct host is IPv6-only without the Supabase IPv4 add-on. | Connect through the IPv4 Supavisor pooler (*.pooler.supabase.com:5432). |
SELECT inet_client_addr() returns an internal IP instead of your static IP |
Traffic passes through Supavisor, which opens its own connection to Postgres. | Verify by enabling Network Restrictions for your dedicated IPv4 (/32) or checking Prontaro Logs. |
| Leaked Relay URL | Secret Relay URL appeared in client code or logs. | Delete the Relay under IP addresses, create a new one, and update PRONTARO_RELAY_URL. |
For 407, 403, and general proxy or CLI issues, see error codes and HTTP & SOCKS5 proxy.
Next steps
- Relay URLs — how Relay URLs work, password protection, and limits.
- Local port forwarding (
prontaro forward) — forward TCP database connections from your dedicated IPv4. - Static IP for Vercel — static IP setup for Vercel Functions and Edge Runtime.
- Static IP in GitHub Actions — run CI migrations and API calls from the same dedicated IPv4.
Related guides
- Relay URLsCall IP-allowlisted HTTPS APIs from edge runtimes and no-code tools without proxy configuration by replacing the base URL with a Prontaro Relay URL.
- Local port forwarding (prontaro forward)Connect database drivers, SFTP clients, and CLI tools to remote servers from your static IPv4 over a local TCP port — no proxy support needed.
- Static IP for VercelSend outbound requests from Vercel Functions and Edge Runtime through one dedicated IPv4 to pass payment gateway, API, and database allowlists.
- Static IP in GitHub ActionsRun GitHub Actions API calls, database migrations, and SSH/SFTP deploys from one dedicated IPv4 instead of allowlisting Azure runner ranges.
Something wrong on this page? Contact us