What is Firebase Hosting?
Firebase Hosting is a fully-managed hosting service for static and dynamic content as well as microservices. The service is backed by SSD storage and a global CDN (content delivery network). Zero-configuration SSL is built into Firebase Hosting, so content is always delivered securely.
What can you host?
Build then host your microservices, API, and forms
Pair Firebase Hosting with Cloud Functions to build microservices using the Express.js framework. This pairing allows you to host your microservices and APIs on Firebase. In addition, you can use a deep integration with Cloud Firestore to build very powerful forms and web apps which can update data in real time.
Host your single-page web apps, marketing websites, and static and dynamic assets
Add a custom domain (or a subdomain)
With Firebase Hosting, you're automatically given a Firebase sub-domain, but
you can choose to serve your content on a
custom domain (like
myrealtimeapp.example.com). Firebase Hosting
provisions an SSL certificate for each of your domains and serves your content
over a global CDN.
Set up production workflows
Before deploying to your live site, you'll want to view and test your changes. Firebase Hosting enables you to view and test changes locally and interact with emulated backend project resources. If you need your teammates to view and test your changes, Hosting can create sharable, temporary preview URLs for your site. We even support a GitHub integration to deploy from a pull request.
Learn more about testing locally, previewing changes, and deploying.
Keep all your sites in one place
Firebase Hosting supports multiple sites in a single Firebase project. Each site hosts its own collection of content, has its own hosting configuration, and can have one or more associated domains. Since the sites are all in the same Firebase project, all the sites can access the other Firebase resources of the project.
You can use multiple sites in a Firebase project to keep related sites together (for example your single-page app, blog, and marketing website).
View, search, and filter your site's web request logs
You can link your Firebase project to Cloud Logging to view, search, and filter your web request logs for each of your Hosting sites. These logs are from the CDN that's automatically provided by Firebase, so every request to your site and the associated request data are logged.
Here are some things you do with Cloud Logging logs:
Better understand your site — Learn from where and when you have visits to your site, your site's response statuses, the latency of end user requests, and more.
Filter your logs with queries — Leverage automatically collected data to filter and plot data associated with each request or your site.
Use logs-based metrics — Create Cloud Monitoring charts and alerting policies from predefined system metrics or user-defined metrics.
Export logs to other Google Cloud tools — Use logs data in other tools (like BigQuery and Data Studio) for more powerful analysis and correlation.
Learn more in the Cloud Logging and Hosting integration page.
Automate continuous deployment with Cloud Build
Firebase Hosting partnered with Cloud Build offers a DevOps-ready solution for automating a continuous deployment workflow for your static and dynamic content as well as for your microservices.
After you configure these tools, you can deploy your web app to Firebase Hosting by simply checking in your code to your git repository.
Error pages — Return a neatly fully customized 404 page from your web app.
Rewrites — Customize which endpoints serve what traffic, and even display the same content from multiple URLs.
Localized content — Serve content that's customized for a user's language preference and/or country.
Headers — Want to access cookies? Use custom headers!
Caching and CDN behavior — Control how your web app is cached across the CDN through custom headers.
Restrict access and counter a DDoS attack for your web apps
Using the power of Express.js middleware, you can build custom logic into serving your microservices, APIs, and other HTTP endpoints. For example, with just a few lines of code, you can integrate popular Node.js middleware offerings to build additional security layers, like access management by IP or protection from denial-of-service (DDoS) attacks.
Deploy to Firebase from various web-based IDEs
These IDEs automatically detect when you're creating a Firebase app and allow you to deploy to Firebase Hosting with the click of a button, without ever leaving the IDE!
Build deep integrations with other Firebase services
Firebase Hosting works out-of-the-box with Firebase services, including Cloud Functions, Authentication, Realtime Database, Cloud Firestore, and Cloud Messaging. You can build powerful microservices and web apps using these complementary Firebase services.
Try out our FriendlyChat web codelab to learn how Hosting pairs with these Firebase services.
Create a custom deployment workflow using REST API and our Node.js modules
We also have a Node.js module which you can import into your Node.js apps to build advanced functionality.