Skip to content
Sections

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.

NeedsDedicated$12/mo$15A dedicated IP for your integrationsGet a dedicated IP

First payment refunded within 7 days if it doesn’t work for you

Edge FunctionsRelay URL
Static IPdedicated, only yours
  • Partner API
Supabase Edge Functions → Relay URL → 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 CLI is needed for Part 1: create Relay URLs or proxy credentials in the dashboard. Local supabase CLI is also optional — manage secrets and functions in the Supabase Dashboard.

Part 1. Outbound static IP for Supabase Edge Functions

Add your dedicated IPv4 (/32) to the partner API’s allowlist, then create a Relay for its hostname in the dashboard:

  1. Open IP addresses in my.prontaro.com, select your IP, and click Add relay address.
  2. Enter api.example.com and copy the generated URL (https://relay-3f9c2a7e-5b1d-4c8a-9e60-1d2b3c4d5e6f.prontaro.run).
IP addressesRelay addressOpen in dashboard

Step 2. Store the secrets in Supabase

Add the secrets in the Supabase Dashboard:

Edge FunctionsSecretsAdd new secret
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):

bash
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:

ts
// 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

  1. Create a temporary Relay for api.ipify.org in the dashboard and store it in a secret named PRONTARO_TEST_RELAY_URL.
  2. Deploy a temporary egress-check function that calls the root of that Relay URL (do not point partner-call at api.ipify.org, because /v1/status returns 404):
ts
// 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 });
});
  1. Copy your project’s anon key 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.10

After 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:

ts
// 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

Project SettingsDatabaseNetwork 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.co hosts are IPv6-only without Supabase’s Dedicated IPv4 add-on. *.pooler.supabase.com resolves to IPv4 and works straight through your Prontaro IPv4.

Start prontaro forward to that host:

bash
prontaro forward 15432 aws-0-eu-central-1.pooler.supabase.com:5432 --ip 203.0.113.10
text
prontaro 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.10

Step 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

Contact us

Enter your email so we can reply.Enter a valid email, e.g. name@company.example.
Tell us what you need or what went wrong.up to 2,000 characters

Sent! We’ll reply to .

Or email us at support@prontaro.com