Firebase
How to Deploy Astro JS to Firebase
Firebase Hosting is Google’s static hosting platform — free, fast, and backed by Google’s global CDN.
This guide walks you through deploying your Blacks project to Firebase Hosting.
Firebase Sign Up

First, create a Firebase account at firebase.google.com. It’s free.
Install Firebase CLI
Install the Firebase CLI globally on your machine:
npm install -g firebase-toolsLog In to Firebase
Authenticate the CLI with your Firebase account:
firebase loginThis opens your browser. Sign in and authorize the CLI.
Initialize Firebase
Create a new folder for your Firebase project, then initialize it:
firebase initFollow the prompts to set up Firebase Hosting.
Move Your Astro Project
Move your Astro JS project into the Firebase project folder.
Then go back to your Firebase dashboard and create a new project — name it whatever you want.
Build Production
Back in your Astro project folder, run the production build:
npm run buildThis generates the dist folder containing your static site.
Deploy to Firebase
After building, access your dist folder from the terminal, then run:
firebase add && firebase deployFirebase uploads your files and publishes them to the global CDN.
Your site is now live at:
https://your-project.web.appUseful Links
For detailed Firebase CLI documentation, visit:
👉 Firebase CLI Documentation →
Build Settings Summary
| Setting | Value |
|---|---|
| Build command | npm run build |
| Output directory | dist |
| Public directory | dist (in Firebase config) |
Troubleshooting
| Problem | Solution |
|---|---|
firebase: command not found | Reinstall with npm install -g firebase-tools |
firebase login fails | Allow popups in your browser, or use firebase login --no-localhost |
| Deploy fails | Run npm run build first before firebase deploy |
| 404 errors | Make sure the public directory is set to dist in firebase.json |
| Changes not showing | Hard refresh in your browser (Ctrl + Shift + R) |
Next Step
Explore other hosting options:
👉 Netlify — alternative static host with drag-and-drop deploy