Firebase

How to set up Firebase Hosting with a custom domain?

Discover how easy it is to set up Firebase Hosting with your own domain. Our detailed guide will take you through each step, so you can launch your website with a custom URL in no time!

Developer profile skeleton
a developer thinking

Overview

Setting up Firebase Hosting with a custom domain? It’s a multi-step process . First, get your Firebase project ready and kick-start Firebase Hosting. Next, you must validate and tweak your custom domain inside the Firebase Console. That means updating your domain's DNS records to direct traffic to Firebase's servers. After your domain gets verified and the DNS updates take effect, Firebase will automatically sort out the SSL certificate, ensuring your site is HTTPS secure. This gives you a broad idea of what’s to come in the step-by-step guide.

Get a Free No-Code Consultation
Meet with Will, CEO at Bootstrapped to get a Free No-Code Consultation
Book a Call
Will Hawkins
CEO at Bootstrapped

How to set up Firebase Hosting with a custom domain?

Step 1: Install Firebase CLI

Alright, first things first, we need to get the Firebase CLI (Command Line Interface) up and running. But before that, make sure you have Node.js installed. Once that's done, just pop open your terminal and type:

npm install -g firebase-tools

Step 2: Log in to Firebase

Next up, let's log in to your Firebase account. In the terminal, run this command:

firebase login

You'll get some prompts. Just follow along, and you'll be logged in before you know it.

Step 3: Initialize Firebase in Your Project

Now, navigate to your project directory. Once you're there, initialize Firebase by running:

firebase init

When the menu pops up, choose the Hosting option. Follow the prompts, and this will set up your project, creating a firebase.json configuration file and a public directory (or whatever directory you choose for public files).

Step 4: Deploy Your Site

Ready to go live? Make sure all your site files are in the public directory (or the directory you specified earlier). Then, deploy your site with:

firebase deploy

Step 5: Add Your Custom Domain in Firebase Console

  1. Head over to the Firebase Console.
  2. Select the project you just deployed.
  3. On the left-hand menu, click Hosting.
  4. Hit the Connect Domain button.
  5. Enter your custom domain and follow the instructions.

Step 6: Configure DNS Records

Firebase will give you some DNS records to add to your domain registrar’s DNS settings. Here's what you need to do:

  1. Log in to your domain registrar's account.
  2. Find the DNS settings or DNS management area.
  3. Add the DNS records provided by Firebase. Usually, these include A records and maybe TXT or CNAME records.

Step 7: Verify Your Domain

Head back to the Firebase Console and click on Verify to wrap things up. Keep in mind, it might take a bit for the DNS changes to kick in.

Step 8: (Optional) Set Up Redirects

If you need to set up redirects, you can do that in the firebase.json file. This is handy for things like HTTP to HTTPS redirection or other URL mappings.

Example:

"hosting": {
  "redirects": [
    {
      "source": "/example",
      "destination": "/example-page",
      "type": 301
    }
  ]
}

Don't forget to deploy again if you make changes to the firebase.json file by running:

firebase deploy

Step 9: Confirm the Setup

Once your domain is verified and the DNS changes have propagated, visit your custom domain URL to make sure everything's working smoothly.

Explore more Firebase tutorials

Complete Guide to Firebase: Tutorials, Tips, and Best Practices

Explore our Firebase tutorials directory - an essential resource for learning how to create, deploy and manage robust server-side applications with ease and efficiency.

Why are companies choosing Bootstrapped?

40-60%

Faster with no-code

Nocode tools allow us to develop and deploy your new application 40-60% faster than regular app development methods.

90 days

From idea to MVP

Save time, money, and energy with an optimized hiring process. Access a pool of experts who are sourced, vetted, and matched to meet your precise requirements.

1 283 apps

built by our developers

With the Bootstrapped platform, managing projects and developers has never been easier.

hero graphic

Our capabilities

Bootstrapped offers a comprehensive suite of capabilities tailored for startups. Our expertise spans web and mobile app development, utilizing the latest technologies to ensure high performance and scalability. The team excels in creating intuitive user interfaces and seamless user experiences. We employ agile methodologies for flexible and efficient project management, ensuring timely delivery and adaptability to changing requirements. Additionally, Bootstrapped provides continuous support and maintenance, helping startups grow and evolve their digital products. Our services are designed to be affordable and high-quality, making them an ideal partner for new ventures.

Engineered for you

1

Fast Development: Bootstrapped specializes in helping startup founders build web and mobile apps quickly, ensuring a fast go-to-market strategy.

2

Tailored Solutions: The company offers customized app development, adapting to specific business needs and goals, which ensures your app stands out in the competitive market.

3

Expert Team: With a team of experienced developers and designers, Bootstrapped ensures high-quality, reliable, and scalable app solutions.

4

Affordable Pricing: Ideal for startups, Bootstrapped offers cost-effective development services without compromising on quality.

5

Supportive Partnership: Beyond development, Bootstrapped provides ongoing support and consultation, fostering long-term success for your startup.

6

Agile Methodology: Utilizing agile development practices, Bootstrapped ensures flexibility, iterative progress, and swift adaptation to changes, enhancing project success.

Yes, if you can dream it, we can build it.