/supabase-tutorials

How to connect Supabase to a custom domain?

Connect your Supabase project to a custom domain with our step-by-step guide covering DNS setup, SSL, and API configuration.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to connect Supabase to a custom domain?

 

Step 1: Set Up Your Custom Domain in Your Registrar

 

  1. Go to your domain registrar where you've purchased your custom domain.
  2. Log in to your account and navigate to the DNS management or Zone File settings for your domain.
  3. Create a new A record:
  • Type: A
  • Name: Use "@" to map to the root of the domain, or specify a subdomain if you prefer (e.g., "api" for api.yourdomain.com).
  • Value: Point this at the IP address of your Supabase instance (This information is typically provided by Supabase in your project's settings).
  • TTL: Default or automatic is usually fine.

 

Step 2: Configure Your Supabase Project's Domain Settings

 

  1. Go to your Supabase dashboard and log into your account.
  2. Select the project you want to configure with your custom domain.
  3. Navigate to the Settings tab on the sidebar.
  4. Under Settings, find the Custom Domain section.
  5. Enter your custom domain or subdomain that you used in Step 1 (e.g., example.com or api.example.com).

 

Step 3: Verify the DNS Setting

 

  1. Supabase will provide a unique DNS verification record that you need to add to your domain settings.
  2. Return to your domain registrar's DNS management settings.
  3. Create a new CNAME record:
  • Type: CNAME
  • Name: Typically this will be something like _supabase-challenge.<yourdomain> provided by Supabase.
  • Value: Point this at the verification target provided by Supabase (e.g., something.supabase.co).
  • TTL: Default or automatic is usually fine.
  1. Save the changes and return to Supabase's dashboard.

 

Step 4: Confirm Verification on Supabase

 

  1. Once the DNS changes propagate, return to the Supabase dashboard.
  2. In the Custom Domain settings, click the button to verify the DNS record.
  3. Supabase will check for the verification record.
  4. If correctly set, Supabase will confirm the domain properly points to your project.

 

Step 5: Secure the Connection with SSL

 

  1. After verifying your domain, ensure your connection is secure with SSL:
  • Supabase automatically provisions an SSL certificate through Let's Encrypt.
  • No additional configuration is typically needed from your side.
  1. Check that your domain is now using HTTPS by visiting it in a browser.

 

Step 6: Update Environment & API Calls

 

  1. Update your application’s environment variables or configuration files to use the custom domain.
  2. Replace any existing Supabase URLs with your custom domain for API calls.

const SUPABASE\_URL = "https://api.example.com";
const SUPABASE\_KEY = "your-anon-key";
  1. Ensure the Supabase client or any other part of your application points to your custom domain.

 

Step 7: Test the Connection

 

  1. Deploy your application updates or restart your local server to make sure everything is on the custom domain.
  2. Perform a few API requests to ensure that your application communicates correctly with Supabase on your custom domain.
  3. Verify that data transactions, user authentication, and other Supabase services function as expected.

 

Step 8: Monitor & Maintain

 

  1. Monitor your domain to ensure the service stays connected and operates smoothly.
  2. Occasionally verify that your SSL certificate is refreshed automatically.
  3. Update Supabase records promptly if you ever change hosts or DNS settings.

 

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022