If you are building server-rendered Angular or Next.js apps, check out next-generation Firebase App Hosting, a full-stack solution for modern web frameworks.
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-10 (世界標準時間)。"],[],[],null,["\u003cbr /\u003e\n\nWhat is Firebase Hosting?\n\nFirebase Hosting is a fully-managed hosting service for static and dynamic\ncontent as well as microservices. The service is backed by SSD storage and a\nglobal CDN (content delivery network). Zero-configuration SSL is built into\nFirebase Hosting, so content is always delivered securely.\n\nWhat can you host?\n\n**Host your single-page web apps, marketing websites, and static and dynamic\nassets**\n\nBenefit from Firebase Hosting's unique optimization for serving single-page\nweb apps and static websites. Delivery of static assets (HTML, CSS, JavaScript,\nfonts, etc.) is powered by our SSD backend storage and a global CDN with edge\nlocations across all major locations in the world. You can even\n[cache your dynamic content](/docs/hosting/manage-cache) on the global CDN. All\nsites hosted by Firebase also get an SSL certificate at no cost, so your\ncontent is always delivered securely.\n\n**Build then host your microservices, API, and forms**\n\nPair Firebase Hosting with [Cloud Functions](/docs/functions) to build microservices\nusing the Express.js framework. This pairing allows you to host your\nmicroservices and APIs on Firebase. In addition, you can use a deep integration\nwith [Cloud Firestore](/docs/firestore) to build very powerful forms and web apps which can\nupdate data in real time.\n| You can also use our new serverless offering, [Cloud Run](/docs/hosting/cloud-run), with Firebase Hosting to generate and host your dynamic content or build then host your microservices, APIs, and forms.\n\nAdd a custom domain (or a subdomain)\n\nWith Firebase Hosting, you're automatically given a Firebase sub-domain, but\nyou can choose to serve your content on a\n[custom domain](/docs/hosting/custom-domain) (like\n`example.com` or `myrealtimeapp.example.com`). Firebase Hosting\nprovisions an SSL certificate for each of your domains and serves your content\nover a global CDN.\n\nSet up production workflows\n\nBefore deploying to your live site, you'll want to view and test your changes.\nFirebase Hosting enables you to view and test changes locally and interact\nwith emulated backend project resources. If you need your teammates to view and\ntest your changes, Hosting can create sharable, temporary preview URLs for\nyour site. We even support a\n[GitHub integration](/docs/hosting/github-integration) to deploy from a pull\nrequest.\n\n[Learn more](/docs/hosting/test-preview-deploy) about testing locally,\npreviewing changes, and deploying.\n\nKeep all your sites in one place\n\nFirebase Hosting supports\n[multiple sites in a single Firebase project](/docs/hosting/multisites). Each\nsite hosts its own collection of content, has its own hosting configuration, and\ncan have one or more associated domains. Since the sites are all in the same\nFirebase project, all the sites can access the other Firebase resources of the\nproject.\n\nYou can use multiple sites in a Firebase project to keep related sites together\n(for example your single-page app, blog, and marketing website).\n\nView, search, and filter your site's web request logs\n\nYou can link your Firebase project to Cloud Logging to view, search, and\nfilter your web request logs for each of your Hosting sites. These logs are\nfrom the CDN that's automatically provided by Firebase, so every request to your\nsite and the associated request data are logged.\n\nHere are some things you do with Cloud Logging logs:\n\n- **Better understand your site** --- Learn from where and when you have visits to\n your site, your site's response statuses, the latency of end user requests,\n and more.\n\n- **Filter your logs with queries** --- Leverage automatically collected data to\n filter and plot data associated with each request or your site.\n\n- **Use logs-based metrics** --- Create Cloud Monitoring charts and alerting\n policies from predefined system metrics or user-defined metrics.\n\n- **Export logs to other Google Cloud tools** --- Use logs data in other tools\n (like BigQuery and Data Studio) for more powerful analysis and correlation.\n\nLearn more in the\n[Cloud Logging and Hosting integration page](/docs/hosting/web-request-logs-and-metrics).\n\nAutomate continuous deployment with Cloud Build \n\nFirebase Hosting partnered with\n[Cloud Build](//cloud.google.com/cloud-build/) offers a\nDevOps-ready solution for automating a continuous deployment workflow for your\nstatic and dynamic content as well as for your microservices.\n\nAfter you configure these tools, you can deploy your web app to\nFirebase Hosting by simply checking in your code to your git repository.\n\nIf you're interested in continuous deployment for full-stack Web apps\ndeveloped in Next.js or Angular Universal, check out the\n[Firebase App Hosting](/docs/app-hosting) preview. App Hosting\nprovides automatic rollouts from a GitHub repository using Cloud Build\nand Cloud Run, without requiring any manual configuration.\n\nCustomize everything!\n\n- [Error pages](/docs/hosting/full-config#404) --- Return a neatly fully\n customized 404 page from your web app.\n\n- [Rewrites](/docs/hosting/full-config#rewrites) --- Customize which endpoints\n serve what traffic, and even display the same content from multiple URLs.\n\n- [Localized content](/docs/hosting/i18n-rewrites) --- Serve content that's\n customized for a user's language preference and/or country.\n\n- [Headers](/docs/hosting/full-config#headers) --- Want to access cookies?\n Use custom headers!\n\n- [Caching and CDN behavior](/docs/hosting/full-config#headers) --- Control\n how your web app is cached across the CDN through custom headers.\n\nRestrict access and counter a DDoS attack for your web apps\n\nUsing the power of Express.js middleware, you can build custom logic into\nserving your microservices, APIs, and other HTTPS endpoints. For example, with\njust a few lines of code, you can integrate popular Node.js middleware offerings\nto build additional security layers, like access management by IP or protection\nfrom denial-of-service (DDoS) attacks.\n\nDeploy to Firebase from various web-based IDEs\n\nFirebase Hosting is integrated with various web-based IDEs so that you can\ndeploy to Firebase Hosting directly from within\n[StackBlitz](https://stackblitz.com/) and [Glitch](https://glitch.com/),\ntwo web-based IDEs.\nDeploy to Firebase Hosting using [Stackblitz](https://stackblitz.com/) Deploy to Firebase Hosting using [Glitch](https://glitch.com/)\n\n\nThese IDEs automatically detect when you're creating a\nFirebase app and allow you to deploy to Firebase Hosting with the click of\na button, without ever leaving the IDE!\n\nBuild deep integrations with other Firebase services\n\nFirebase Hosting works out-of-the-box with Firebase services, including\n[Cloud Functions](/docs/functions),\n[Authentication](/docs/auth),\n[Realtime Database](/docs/database),\n[Cloud Firestore](/docs/firestore), and\n[Cloud Messaging](/docs/cloud-messaging).\nYou can build powerful microservices and web apps using these complementary\nFirebase services.\n\nTry out our\n[FriendlyChat web codelab](https://codelabs.developers.google.com/codelabs/firebase-web/#0)\nto learn how Hosting pairs with these Firebase services.\n\nCreate a custom deployment workflow using REST API and our Node.js modules\n\nFirebase Hosting supports a [REST API](/docs/reference/hosting/rest) for\nadvanced developers to build custom workflows, like deploying through a\nJavaScript app.\n\nWe also have a [Node.js module](https://github.com/firebase/firebase-tools)\nwhich you can import into your Node.js apps to build advanced functionality."]]