Disclaimer: As an Amazon Associate, Zeyhar Tech earns from qualifying purchases. This means we may earn a small commission at no extra cost to you if you buy through our links
You have spent weeks writing clean code, and your project is finally working perfectly on your local machine. Now comes the hard part: getting it live on the internet. Whether you are launching a personal developer portfolio or deploying a custom BMIApp calculator you built from scratch, Firebase Hosting is one of the fastest, most secure, and completely free ways to get your web app in front of real users.
Here is the exact step-by-step workflow to push your code from your local terminal to a live global server in under five minutes.
Before you can deploy, you need the Firebase Command Line Interface. Open your terminal and run the following npm command (you will need Node.js installed on your computer first): npm install -g firebase-tools
Connect your terminal to your Google account where your Firebase project is hosted. Run: firebase login This will open a browser window asking you to authenticate.
Navigate to your project's root folder in the terminal and tell Firebase you want to set up hosting: firebase init Use your arrow keys to select Hosting, then choose your existing Firebase project from the list. When it asks for your public directory, type build or public (depending on your framework), and select "Yes" to configure as a single-page app if you are using React or Vue.
Once initialized, deploying your site takes a single, satisfying command: firebase deploy Within seconds, the terminal will spit out a live "Hosting URL." Click it, and your app is officially live on the web!