How to Deploy Your Vite + React App in Minutes Using Firebase Hosting


Every now and then, friends ask me how to easily host a web application to share with others — whether it’s an MVP, a side project, or even a prototype still in development.
My answer is usually the same: use Firebase Hosting. It’s simple, quick to set up, and offers a generous free tier — especially for lightweight apps built with Vite.
And why not Vercel?
I just want to rebel. Everyone keeps screaming Vercel, I prefer to whisper Firebase. So let’s go to a straight-to-the-point tutorial on how to host your Vite + React app on Firebase Hosting!
(Vercel, you’re still the undisputed SSR champ. I’m literally writing this on your platform, so... no hard feelings, right?)
Before we start…
First of all, we need to install the Firebase CLI and connect our account.
Run the following command in your terminal to install it globally via NPM:
npm install -g firebase-tools
Then run:
firebase login
A browser window will pop up so you can log in with your Google account. Once logged in, we’re good to go.
Configuring Firebase Hosting
Now, let’s configure Firebase Hosting inside our project. To initialize it, open the terminal in your app’s root directory and run:
firebase init
A list of options will appear. Use the arrow keys to navigate to "Hosting", press space to select it. It’ll look like the image below. Just press Enter to proceed.
Next, you’ll need to choose a Firebase project to link to your app. You can:
Create it before via the Firebase Console and select "Use an existing project", or
Create one directly from the terminal, which we’ll do here by selecting "Create a new project".
To create the project, we need to choose a unique project ID — it will be part of the auto-generated domain and you can’t change it later. The project name is optional and defaults to the same ID, so you can just leave it empty.
For this guide, let’s go with lkdev-hosting-example
.
Vite detection and additional settings
Firebase will automatically detect you’re using Vite and ask whether you want to configure things based on that. Type Y
and continue.
Next, a few important prompts:
In which region would you like to host server-side content, if applicable?
This is only relevant if you plan to use server-side rendering (SSR). If so, you may need to add a billing method and switch from the free plan. Otherwise, choose a nearby region and move on — no card needed.Set up automatic builds and deploys with GitHub?
For this quickstart, say no. This option helps you set up CI/CD pipelines, but we’ll skip it for now.
And done! Your Firebase Hosting configuration is now complete.
Time to deploy
Here comes the magic.
With everything ready, simply run:
firebase deploy
Firebase will do it’s thing, and when it’s done, your app will be up and running at two default domains: your-app-id.web.app
and your-app-id.firebaseapp.com
.
And… congrats — you’ve officially launched your app!
Bonus: Adding a Custom Domain
To add a custom domain, simply go to the "Hosting" section in the Firebase Console and click on "Add custom domain".
Then, enter the domain you've purchased and follow the instructions to add the necessary DNS records in your provider's panel (like GoDaddy, for example).
Once the DNS records are properly set, Firebase Hosting will automatically detect them and handle everything else — including setting up SSL certificates — making your custom domain ready to serve your app.
Job’s done
Pretty straightforward, right?
Firebase Hosting is a fantastic way to get your projects online quickly and with minimal effort — and honestly, I love that.
There’s a lot more you can do with this powerful tool that i love from the bottom of my heart (thank you Mr. Google), so maybe I’ll cover some of it in a future post.
But for today, job’s done.
Hope this helped you in some way.
Thanks for reading, and may God bless you!
Subscribe to my newsletter
Read articles from Luis Kern directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Luis Kern
Luis Kern
Frontend-focused Software Engineer with 6+ years of experience building web applications using React.js. Also experienced in backend development with .NET and Firebase.