Files
supabase/apps/docs/content/guides/platform/privatelink.mdx
supabase-vercel-tedd[bot]andAlexis Aguilar a30c99d09d docs(platform): say that PrivateLink doesn't carry Data API or client library traffic (#53767)
## Problem

The PrivateLink page said PrivateLink doesn't support "API, Storage,
Auth, or Realtime". Readers couldn't tell that "API" meant the Data API,
so they couldn't tell whether requests from `supabase-js` and the other
client libraries go over the private connection.

Related to
[FDBKIN-15262](https://linear.app/supabase/issue/FDBKIN-15262/clarify-in-docs-what-traffic-is-routed-through-privatelink)
Closes [DOCS-1725](https://linear.app/supabase/issue/DOCS-1725)

## Solution

The PrivateLink page now names the Data API (REST and GraphQL) and links
to its guide. It also says that the client libraries call the project
URL over the public internet, not PrivateLink. A backend whose database
traffic must stay private should connect to Postgres directly or through
the dedicated pooler. "How PrivateLink works" and the "Service Scope"
limitation now say the same thing. Only that existing text changed, and
the page has no new section.

## How to verify

On the preview, open `/docs/guides/platform/privatelink`:

1. "How PrivateLink works" says PrivateLink carries only Postgres
connections on ports `5432` and `6543`. It also says the client
libraries call the Data API, Auth, Storage, and Realtime at
`https://<project_ref>.supabase.co` over the public internet.
2. The same section says what to do when a backend's database traffic
must stay private.
3. The "Service Scope" bullet under "Limitations" says the same thing.
4. Both "Data API" links open `/docs/guides/api`.

## Checks

Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm
turbo run lint --filter='[origin/master]'`, and Prettier on the changed
file. All passed. I skipped the `docs` tests because they need Docker. I
checked the facts against the page's own setup steps (the endpoint is a
database host on ports `5432` and `6543`), the Studio PrivateLink form
(each connection targets a database), and `guides/api.mdx`, which gives
the Data API URL as `https://<project_ref>.supabase.co/rest/v1/`.

## Second reader

Verdict: ready, no blockers. I fixed these nits:

- The project URL was stated twice in a row. I merged the two sentences.
- The new host clause covered the PrivateLink endpoint option but not
the VPC Lattice service network option. I dropped it, because the setup
steps already cover hostnames.
- "If your backend's traffic must stay private" promised too much,
because Auth, Storage, and Realtime can't go private. It now says
"database traffic".
- I made the run-on sentence in the "Service Scope" bullet easier to
read.

These are left as they were:

- The reader suggested
`/docs/guides/database/connecting-to-postgres#data-apis-and-client-libraries`
as the link target. I kept `/docs/guides/api`, the Data API's own guide.
- These problems are on the page but outside this change: "organisation
level" spelling, "e.g.", the missing period on "Feature Evolution", a
note written as a numbered step, and Edge Functions missing from the
list of public services.

Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com>
2026-11-23 13:53:55 -07:00

209 lines
12 KiB
Plaintext

---
id: 'privatelink'
title: 'PrivateLink'
description: 'Secure private network connectivity to your Supabase database using AWS VPC Lattice.'
---
<Admonition type="note">
PrivateLink is available only to Team and Enterprise customers.
</Admonition>
PrivateLink provides enterprise-grade private network connectivity between your AWS VPC and your [Supabase database](/docs/guides/database/overview) using AWS VPC Lattice. This eliminates exposure to the public internet by creating a secure, private connection that keeps your database traffic within the AWS network backbone.
By enabling PrivateLink, database connections never traverse the public internet, enabling the disablement of public facing connectivity and providing an additional layer of security and compliance for sensitive workloads. This infrastructure-level security feature helps organizations meet strict data governance requirements and reduces potential attack vectors.
## How PrivateLink works
Supabase PrivateLink is an organisation level configuration. It works by sharing a [VPC Lattice Resource Configuration](https://docs.aws.amazon.com/vpc-lattice/latest/ug/resource-configuration.html) to any number of AWS Accounts for each of your Supabase projects. Connectivity can be achieved by either associating the Resource Configuration to a PrivateLink endpoint, or a [VPC Lattice Service Network](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html). This means:
- Database traffic flows through private AWS infrastructure only
- Network isolation provides enhanced security posture
- Attack surface is minimized by eliminating public exposure
The connection architecture changes from public internet routing to a dedicated private path through AWS's secure network backbone.
Supabase PrivateLink carries only Postgres connections: direct database connections on port `5432` and dedicated pooler (PgBouncer) connections on port `6543`. It doesn't carry the [Data API](/docs/guides/api) (REST and GraphQL), Auth, Storage, or Realtime.
The Supabase client libraries, such as `supabase-js`, call these services at the project URL, `https://<project_ref>.supabase.co`, over the public internet, not PrivateLink. If your backend's database traffic must stay private, connect it to Postgres directly or through the dedicated pooler over PrivateLink, instead of through the Data API.
## Requirements
To use PrivateLink with your Supabase project:
- Team or Enterprise Supabase subscription
- AWS VPC in the same region as your Supabase project
- Appropriate permissions to accept Resource Shares, and create and manage endpoints
## Getting started
### Step 1: Add connection
Navigate to your project's Integrations section to set up PrivateLink:
1. Go to your Supabase project dashboard
2. Navigate to [**Settings** > **Integrations**](/dashboard/project/_/settings/integrations)
3. Find the **AWS PrivateLink** section
4. Click **Add connection**
5. Enter the destination AWS account ID
6. Select the database: the primary database or a specific read replica
7. Optionally add a description
8. Click **Add connection** to submit
Each database, whether the primary or a read replica, needs its own connection. Create a separate connection for every database you want to reach over PrivateLink.
After submission, Supabase creates a VPC Lattice Resource Configuration for your project and sends an AWS Resource Share to the specified AWS account ID. This process may take a few moments. Once complete, the connection will show a "Waiting" status, indicating that the resource share has been sent to your AWS account and still needs to be accepted. You must accept the resource share within 12 hours, or the request expires and can no longer be accepted in AWS. You'll need to create a new connection to try again.
Select **View connection** to see the VPC Lattice resource configuration ID and ARNs for the connection. This is useful for confirming which resource configuration corresponds to which database when a project has multiple connections, for example one for the primary database and one for each read replica.
### Step 2: Accept resource share
Supabase will send you an AWS Resource Share containing the VPC Lattice Resource Configurations for your projects. To accept this share:
1. Sign in to your AWS Management Console, ensure you are in the AWS region where your Supabase project is located
2. Navigate to the AWS Resource Access Manager (RAM) console
3. Go to [Shared with me > Resource shares](https://console.aws.amazon.com/ram/home#SharedResourceShares)
4. Locate the resource share from Supabase.
- The resource share has the format `sspl-[project_ref]-[random alphanumeric string]`
- If your project has multiple connections, for example one for the primary database and one for each read replica, match the share's ARN to the **Resource share ARN** shown for that connection in **View connection** to confirm you're accepting the correct one
5. Click on the resource share name to view details. Review the list of resource shares - it should only include resources of type vpc-lattice:ResourceConfiguration.
6. Click **Accept resource share**
7. Confirm the acceptance in the dialog box
After accepting, you'll see the resource configurations appear in your [Shared with me > Shared resources](https://console.aws.amazon.com/ram/home#SharedResources) section of the RAM console and the [PrivateLink and Lattice > Resource configurations](https://console.aws.amazon.com/vpcconsole/home#ResourceConfigs) section of the VPC console.
### Step 3: Configure security groups
Ensure your security groups allow traffic on the appropriate ports:
1. Navigate to the [VPC console > Security Groups](https://console.aws.amazon.com/vpcconsole/home#SecurityGroups:)
2. Create a new security group for the endpoint or service network by clicking [Create security group](https://console.aws.amazon.com/vpcconsole/home#CreateSecurityGroup:)
3. Give your security group a descriptive name and select the appropriate VPC
4. Add inbound rule(s) for the connection mode you use:
- Direct connection: Postgres (TCP, port `5432`)
- Dedicated pooler connection: Custom TCP (port `6543`)
- If you use both direct and dedicated pooler connections, add both rules
- Set the destination appropriate for your network (for example, your VPC subnet or your application instances' security group)
5. Finish creating the security group by clicking **Create security group**
### Step 4: Create connection
In your AWS account, you have two options to establish connectivity:
#### Option A: Create a PrivateLink endpoint
1. Navigate to the VPC console in your AWS account
2. Go to [Endpoints](https://console.aws.amazon.com/vpcconsole/home#Endpoints:) in the left sidebar
3. Click [Create endpoint](https://console.aws.amazon.com/vpcconsole/home#CreateVpcEndpoint:)
4. Give your endpoint a name (e.g. `supabase-privatelink-[project name]`)
5. Under Type, select **Resources**
6. In the **Resource configurations** section select the appropriate resource configuration
- The resource configuration name will be in the format `[organisation]-[project-ref]-rc`
- If you have multiple connections, match the **Resource configuration ID** shown for that connection in **View connection** to confirm you select the configuration for the correct database
7. Select your VPC from the dropdown. This should match the VPC you selected for your security group in Step 3
8. Choose the appropriate subnets for your network
- AWS will provision a private ENI for you in each selected subnet
- IP address type should be set to IPv4
9. Choose the security group you created in Step 3.
10. Optionally, select **Enable private DNS name** to use a Supabase hostname instead of the endpoint DNS name
- The private DNS name is `db.[project_ref].privatelink.supabase.co`
- It resolves only to the endpoint from within the selected VPC
- Your VPC must have **DNS resolution** and **DNS hostnames** enabled
11. Click **Create endpoint**
12. After creation, you will see the endpoint in the [Endpoints](https://console.aws.amazon.com/vpcconsole/home#Endpoints:) section with a status of "Available"
13. For connectivity:
- The IP addresses of the endpoint will be listed in the **Subnets** section of the endpoint details
- The DNS record will be in the **Associations** section of the endpoint details in the **DNS Name** field
- If you enabled a private DNS name, use `db.[project_ref].privatelink.supabase.co`
#### Option B: Attach resource configuration to an existing VPC lattice service network
1. **This method is only recommended if you have an existing VPC Lattice Service Network**
2. Navigate to the VPC Lattice console in your AWS account
3. Go to [Service networks](https://console.aws.amazon.com/vpcconsole/home#ServiceNetworks) in the left sidebar and select your service network
4. In the service network details, go to the **Resource configuration associations** tab
5. Click **Create associations**
6. Select the appropriate **Resource configuration** from the dropdown
- If you have multiple connections, match the **Resource configuration ID** shown for that connection in **View connection** to confirm you select the configuration for the correct database
7. Click **Save changes**
8. After creation, you will see the resource configuration in the Resource configurations section of your service network with the status "Active"
9. For connectivity, click on the association details and the domain name will be listed in the **DNS entries** section
### Step 5: Test connectivity
Verify the private connection is working correctly from your VPC:
1. Launch an EC2 instance or use an existing instance within your VPC
2. Install a Postgres client (e.g., `psql`)
3. Test the connection using the private endpoint:
```bash
# Direct connection (Postgres)
psql "postgresql://[username]:[password]@[private-endpoint]:5432/postgres"
# Dedicated pooler connection
psql "postgresql://[username]:[password]@[private-endpoint]:6543/postgres"
```
You should see a successful connection without any public internet traffic.
### Step 6: Update applications
Configure your applications to use the private connection details:
1. Update your database connection strings to use the private endpoint hostname
2. Ensure your application instances are in the same VPC or connected VPCs
3. Update any database connection pooling configurations
4. Test application connectivity thoroughly
Example connection string updates:
```
# Direct connection (Postgres)
# Before (public)
postgresql://user:pass@db.[project-ref].supabase.co:5432/postgres
# After (private)
postgresql://user:pass@your-private-endpoint.vpce.amazonaws.com:5432/postgres
# After (private, with private DNS name enabled)
postgresql://user:pass@db.[project-ref].privatelink.supabase.co:5432/postgres
# Dedicated pooler connection
# Before (public)
postgresql://user:pass@db.[project-ref].supabase.co:6543/postgres
# After (private)
postgresql://user:pass@your-private-endpoint.vpce.amazonaws.com:6543/postgres
# After (private, with private DNS name enabled)
postgresql://user:pass@db.[project-ref].privatelink.supabase.co:6543/postgres
```
### Step 7: Restrict public database access (optional)
For maximum security, you can restrict public database access in your project settings:
1. Go to [**Database** > **Settings**](/dashboard/project/_/database/settings)
2. In **Network Restrictions**, enable **Restrict all access**
3. Ensure all applications, monitoring, and backup tools are using the private endpoint before enabling this setting
## Limitations
- **Service Scope**: PrivateLink only supports Postgres connections, direct or through the dedicated [pooler](/docs/guides/database/connecting-to-postgres/pooling-and-limits). The [Data API](/docs/guides/api), Auth, Storage, and Realtime use the public internet, and so do the Supabase client libraries that call them.
- **Feature Evolution**: The setup process and capabilities may evolve as we refine the offering
## Compatibility
The PrivateLink endpoint is a layer 3 solution so behaves like a standard Postgres endpoint, allowing you to connect using:
- Direct Postgres connections using standard tools
- Third-party database tools and ORMs (with the appropriate routing)
## Next steps
Ready to enhance your database security with PrivateLink? [Contact our Enterprise team](/contact/enterprise) to discuss your requirements and begin the setup process.
Our support team will guide you through the configuration and ensure your private database connectivity meets your security and performance requirements.