Adding a custom domain to your Supabase project means bypassing the default *.supabase.co subdomain and using your own branded URL.
Here’s Supabase running with a custom domain, serving assets and API requests directly from your project:
# Example: Fetching data from your API
curl https://my.custom.domain/rest/v1/todos \
-H "apikey: YOUR_SUPABASE_ANON_KEY" \
-H "Authorization: Bearer YOUR_SUPABASE_ANON_KEY"
# Example: Accessing storage
curl https://my.custom.domain/storage/v1/object/public/avatars/user1.png
The core problem Supabase custom domains solve is brand consistency and user trust. When your app or API is served from yourcompany.com instead of a generic subdomain, it feels more professional and trustworthy. Internally, Supabase handles this by acting as a reverse proxy. When a request hits your custom domain, Supabase’s infrastructure routes it to the correct underlying project resources (PostgreSQL database, storage buckets, auth endpoints, etc.) based on the hostname and path. This keeps your project’s infrastructure managed by Supabase while presenting a seamless user experience.
The primary levers you control are DNS records. You’ll need to create two types of records in your domain registrar’s DNS settings:
- An
Arecord pointing your root domain (e.g.,yourdomain.com) or a subdomain (e.g.,api.yourdomain.com) to Supabase’s load balancer IP address. - A
CNAMErecord forwww(if you wantwww.yourdomain.comto work) pointing to your root domain, or directly to your Supabase domain if you’re using a subdomain for your API.
Let’s walk through the setup.
First, go to your Supabase project’s dashboard. Navigate to Project Settings > Custom Domains. You’ll see a section asking you to add your domain.
Enter your desired custom domain, for example, app.yourdomain.com. Supabase will then provide you with the necessary DNS records. Typically, this will be an IP address for an A record and potentially a CNAME target.
Now, log in to your domain registrar (e.g., GoDaddy, Namecheap, Cloudflare). Navigate to the DNS management section for yourdomain.com.
Scenario 1: Using a subdomain for your Supabase API (e.g., api.yourdomain.com)
-
Create an
Arecord:- Type:
A - Host/Name:
api(or whatever subdomain you chose) - Value/Points to:
75.2.106.24(This is Supabase’s current IP. Always check your Supabase dashboard for the most up-to-date value.) - TTL:
3600(or your registrar’s default)
- Type:
-
Create a
CNAMErecord (if you wantwww.api.yourdomain.comto also work):- Type:
CNAME - Host/Name:
www.api - Value/Points to:
api.yourdomain.com - TTL:
3600
- Type:
Scenario 2: Using your root domain for Supabase (e.g., yourdomain.com)
-
Create an
Arecord:- Type:
A - Host/Name:
@(or leave blank, depending on your registrar) - Value/Points to:
75.2.106.24 - TTL:
3600
- Type:
-
Create a
CNAMErecord (forwww):- Type:
CNAME - Host/Name:
www - Value/Points to:
yourdomain.com - TTL:
3600
- Type:
After adding these records, it can take anywhere from a few minutes to 48 hours for DNS changes to propagate across the internet. You can check the status in your Supabase Custom Domains dashboard. Once verified, Supabase will automatically provision an SSL certificate for your domain.
The most surprising part of this process is how Supabase handles SSL. You don’t need to generate or upload certificates yourself. Once your DNS records are correctly pointed and verified, Supabase automatically provisions and renews a Let’s Encrypt SSL certificate for your custom domain, ensuring secure HTTPS connections without any manual intervention on your part. This is a significant operational simplification.
Once your custom domain is active, the next step is often to configure your Supabase Storage bucket URLs to use this new domain for serving assets, or to update your application’s frontend to use the custom domain for API calls.