サーバーでレンダリングされる Angular または Next.js アプリを構築する場合は、最新のウェブ フレームワーク向けのフルスタック ソリューションである次世代の
Firebase App Hosting をご確認ください。
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Firebase Hosting
plat_web
Firebase Hosting は、ウェブアプリの高速で安全なホスティングを提供します。
Firebase Hosting はデベロッパー向けの、本番環境レベルのウェブ コンテンツ ホスティングです。1 つのコマンドで、ウェブアプリをグローバル CDN(コンテンツ配信ネットワーク)にすばやくデプロイできます。
Firebase Hosting は静的ウェブアプリと単一ページ型ウェブアプリ用に最適化されていますが、Firebase Hosting を Cloud Functions または Cloud Run と組み合わせて、Firebase で動的コンテンツとマイクロサービスを構築してホストすることもできます。
始めましょう
主な機能
安全な接続でコンテンツを配信 |
Firebase Hosting には構成不要の SSL が組み込まれているため、コンテンツを常に安全に配信できます。 |
コンテンツを高速で配信 |
アップロードしたファイルは、世界中に配置されている CDN エッジで SSD のキャッシュに保存され、gzip または Brotli として提供されます。コンテンツに最適な圧縮方法が自動的に選択されます。ユーザーがどこにいても、コンテンツを高速に配信できます。
|
公開前に変更をエミュレートして共有 |
ローカルでホストされる URL で変更を表示してテストし、エミュレートしたバックエンドとやり取りできます。
一時的なプレビュー URL を使用して同僚と変更内容を共有できます。また、Hosting は、プレビューしたコンテンツを簡単にイテレーションできる GitHub 統合も提供しています。
|
1 つのコマンドで新しいバージョンをデプロイ |
Firebase CLI を使用して、アプリを迅速に稼働させることができます。コマンドライン ツールにより、デプロイ ターゲットをビルドプロセスに追加できます。
デプロイを元に戻す場合も、Hosting ではワンクリックでロールバックできます。
|
仕組み
デプロイするのがシンプルなアプリ ランディング ページであっても、複雑なプログレッシブ ウェブアプリ(PWA)であっても、Hosting はウェブサイトとアプリのデプロイと管理に適したインフラストラクチャ、機能、ツールを提供します。
Firebase CLI を使用して、お使いのパソコンのローカル ディレクトリから Hosting サーバーにファイルをデプロイできます。静的コンテンツを配信する以外に、Cloud Functions for Firebase または Cloud Run を使用すると、自分のサイトで動的コンテンツの配信とマイクロサービスのホスティングを行うことができます。コンテンツはすべて、グローバル CDN の最も近いエッジサーバーから SSL 接続を介して配信されます。
また、公開前に変更内容を表示してテストすることも可能です。Firebase Local Emulator Suite を使用すると、ローカルでホストされる URL でアプリとバックエンド リソースをエミュレートできます。また、一時的なプレビュー URL を使用して変更を共有できるほか、GitHub 統合を設定すれば、開発中に簡単にイテレーションが行えます。
Firebase Hosting には、高機能の PWA のビルドに使用できる軽量なホスティング構成オプションがあります。クライアントサイドでのルーティング用の URL の書き換えやカスタム ヘッダーの設定、さらにはローカライズされたコンテンツの提供も簡単に行うことができます。
コンテンツを配信するため、Firebase にはいくつかのドメイン オプションとサブドメイン オプションがあります。
デフォルトでは、すべての Firebase プロジェクトに web.app
ドメインと firebaseapp.com
ドメインのサブドメインが無料で用意されています。これら 2 つのサイトが、同じデプロイ済みのコンテンツと構成を配信します。
異なるコンテンツを配信しながら同じ Firebase プロジェクト リソースを共有する、関連サイトやアプリがある場合(たとえばブログ、管理パネル、公開アプリがある場合)は、複数のサイトを作成できます。
Firebase のホストサイトに独自のドメイン名を接続できます。
Firebase は、すべてのコンテンツが安全に配信されるように、すべてのドメインに SSL 証明書を自動的にプロビジョニングしています。
実装パス
|
Firebase CLI をインストールする |
Firebase CLI を使用すれば、新しい Hosting プロジェクトの設定、ローカルの開発サーバーの実行、コンテンツのデプロイを簡単に行うことができます。
|
|
プロジェクト ディレクトリを設定する |
静的アセットをローカル プロジェクト ディレクトリに追加してから、firebase init を実行してディレクトリを Firebase プロジェクトに接続します。
ローカル プロジェクト ディレクトリでは、動的コンテンツとマイクロサービス用に Cloud Functions または Cloud Run を設定することもできます。
|
|
公開前に変更内容を表示、テスト、共有する(省略可) |
firebase emulators:start を実行して、ローカルにホストされる URL で Hosting とバックエンド プロジェクトのリソースをエミュレートします。
一時的なプレビュー URL で変更を表示して共有するには、firebase hosting:channel:deploy を実行してプレビュー チャネルを作成し、デプロイします。プレビューしたコンテンツを簡単にイテレーションできるよう GitHub の統合を設定します。
|
|
サイトをデプロイする |
すべて問題がなければ、firebase deploy を実行して最新のスナップショットをサーバーにアップロードします。デプロイを元に戻す必要がある場合も、Firebase コンソールでワンクリックでロールバックできます。 |
|
Firebase ウェブアプリにリンクする(省略可) |
サイトを Firebase ウェブアプリにリンクすることで、Google Analytics を使用してアプリの使用状況と動作データを収集し、Firebase Performance Monitoring を使用してアプリのパフォーマンス特性を分析できます。
|
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-08 UTC。
[null,null,["最終更新日 2025-08-08 UTC。"],[],[],null,["Firebase Hosting \nplat_web \nFirebase Hosting provides fast and secure hosting for your web app. \n\nFirebase Hosting is production-grade web content hosting for developers.\nWith a single command, you can quickly deploy web apps to a global CDN (content\ndelivery network).\n\nThough Firebase Hosting is optimized for static and\nsingle-page web apps, you can also [pair Firebase Hosting with\nCloud Functions or Cloud Run](/docs/hosting/serverless-overview) to\nbuild and host dynamic content and microservices on Firebase.\n\n[Get started](/docs/hosting/quickstart)\n\nKey capabilities\n\n|-------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Serve content over a secure connection | Zero-configuration SSL is built into Firebase Hosting, so content is always delivered securely. |\n| Deliver content fast | Each file that you upload is cached on SSDs at CDN edges around the world and served as gzip or Brotli. We auto-select the best compression method for your content. No matter where your users are, the content is delivered fast. |\n| Emulate and even share your changes before going live | View and test your changes on a locally hosted URL and interact with an emulated backend. Share your changes with teammates using temporary preview URLs. Hosting also provides a [GitHub integration](/docs/hosting/github-integration) for easy iterations of your previewed content. |\n| Deploy new versions with one command | Using the Firebase CLI, you can get your app up and running in seconds. Command line tools let you add deployment targets into your build process. And if you need to undo the deploy, Hosting provides one-click rollbacks. |\n\nHow does it work?\n\nWhether you are deploying a simple app landing page or a complex Progressive Web\nApp (PWA), Hosting gives you the infrastructure, features, and tooling\ntailored to deploying and managing websites and apps.\n\nUsing the [Firebase CLI](/docs/cli), you deploy files from local directories\non your computer to our Hosting servers. Beyond serving static content, you\ncan use Cloud Functions for Firebase or Cloud Run to\n[serve dynamic content and host microservices](/docs/hosting/serverless-overview)\non your sites. All content is\nserved over an SSL connection from the closest edge server on our global CDN.\n\nYou can also\n[view and test your changes before going live](/docs/hosting/test-preview-deploy).\nUsing the Firebase Local Emulator Suite,\nyou can emulate your app and backend resources at a locally hosted URL. You can\nalso share your changes at a temporary preview URL and set up a [GitHub\nintegration](/docs/hosting/github-integration) for easy iterations during\ndevelopment.\n\nFirebase Hosting has lightweight\n[hosting configuration options](/docs/hosting/full-config) for you\nto build sophisticated PWAs. You can\neasily rewrite URLs for client-side routing, set up custom headers, and even\nserve localized content.\n\nFor serving your content, Firebase offers several domain and subdomain options:\n\n- By default, every Firebase project has subdomains at no cost on the\n `web.app` and `firebaseapp.com` domains. These two sites serve the same\n deployed content and configuration.\n\n- You can [create multiple sites](/docs/hosting/multisites) if you have\n related sites and apps that serve different content but still share the same\n Firebase project resources (for example if you have a blog, admin panel, and\n public app).\n\n- You can [connect your own domain name](/docs/hosting/custom-domain) to a\n Firebase-hosted site.\n\nFirebase automatically provisions SSL certificates for all your domains so that\nall your content is served securely.\n\nImplementation path\n\n|---|-------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | Install the Firebase CLI | The [Firebase CLI](/docs/cli) makes it easy to set up a new Hosting project, run a local development server, and deploy content. |\n| | Set up a project directory | Add your static assets to a local project directory, then run firebase init to connect the directory to a Firebase project. In your local project directory, you can also set up Cloud Functions or Cloud Run for your [dynamic content and microservices](/docs/hosting/serverless-overview). |\n| | View, test, and share your changes before going live *(optional)* | Run firebase emulators:start to emulate Hosting and your backend project resources at a locally hosted URL. To view and share your changes at a temporary preview URL, run firebase hosting:channel:deploy to create and deploy to a preview channel. Set up the [GitHub integration](/docs/hosting/github-integration) for easy iterations of your previewed content. |\n| | Deploy your site | When things are looking good, run firebase deploy to upload the latest snapshot to our servers. If you need to undo the deploy, you can roll back with just one click in the Firebase console. |\n| | Link to a Firebase Web App *(optional)* | By linking your site to a [Firebase Web App](/docs/web/setup), you can use [Google Analytics](/docs/analytics/get-started?platform=web) to collect usage and behavior data for your app and use [Firebase Performance Monitoring](/docs/perf-mon/get-started-web) to gain insight into the performance characteristics of your app. |\n\nNext steps\n\n- [Get started](/docs/hosting/quickstart) with Firebase Hosting.\n\n- Continue to improve your site. Test locally, share changes at a temporary\n preview URL, then deploy to your live site. Follow this [step-by-step\n guide](/docs/hosting/test-preview-deploy).\n\n- [Build and host microservices](/docs/hosting/serverless-overview) on\n Firebase."]]