Jika Anda membangun aplikasi Angular atau Next.js yang dirender server, lihat Firebase App Hosting generasi berikutnya, sebuah solusi full stack untuk framework web modern.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Dengan CLI berbasis framework Firebase, Anda dapat men-deploy aplikasi Flutter ke Firebase.
Sebelum memulai
Sebelum Anda mulai men-deploy aplikasi ke Firebase, tinjau persyaratan dan opsi berikut:
Firebase CLI versi 12.1.0 atau yang lebih baru. Pastikan untuk menginstal CLI menggunakan metode pilihan Anda.
Opsional: Penagihan diaktifkan di project Firebase Anda (wajib jika Anda berencana menggunakan SSR)
Melakukan inisialisasi Firebase
Untuk memulai, lakukan inisialisasi Firebase untuk project framework Anda.
Gunakan Firebase CLI untuk project baru, atau ubah firebase.json untuk project yang sudah ada.
Melakukan inisialisasi project baru
Di Firebase CLI, aktifkan pratinjau framework web:
firebase experiments:enable webframeworks
Jalankan perintah inisialisasi dari CLI, lalu ikuti petunjuknya:
firebase init hosting
Jawab ya untuk "Do you want to use a web framework? (eksperimental)"
Pilih direktori sumber hosting Anda; ini bisa berupa aplikasi Flutter yang sudah ada.
Jika diminta, pilih Web Flutter.
Melakukan inisialisasi project yang sudah ada
Ubah konfigurasi hosting Anda di firebase.json agar memiliki opsi source, bukan opsi public. Contoh:
[null,null,["Terakhir diperbarui pada 2025-08-31 UTC."],[],[],null,["\u003cbr /\u003e\n\nWith the Firebase framework-aware CLI, you can deploy your Flutter application\nto Firebase.\n| **Note:** Framework-aware Hosting is an early public preview. This means that the functionality might change in backward-incompatible ways. A preview release is not subject to any SLA or deprecation policy and may receive limited or no support.\n\nBefore you begin\n\nBefore you get started deploying your app to Firebase,\nreview the following requirements and options:\n\n- Firebase CLI version 12.1.0 or later. Make sure to [install the CLI](/docs/cli#install_the_firebase_cli) using your preferred method.\n- Optional: Billing enabled on your Firebase project (required if you plan to use SSR)\n\nInitialize Firebase\n\nTo get started, initialize Firebase for your framework project.\nUse the Firebase CLI for a new project, or modify `firebase.json` for an\nexisting project.\n\nInitialize a new project\n\n1. In the Firebase CLI, enable the web frameworks preview: \n\n ```\n firebase experiments:enable webframeworks\n ```\n2. Run the initialization command from the CLI and then follow the prompts:\n\n ```\n firebase init hosting\n ```\n\n \u003cbr /\u003e\n\n3. Answer yes to \"Do you want to use a web framework? (experimental)\"\n\n4. Choose your hosting source directory; this could be an existing Flutter app.\n\n5. If prompted, choose Flutter Web.\n\nInitialize an existing project\n\nChange your hosting config in `firebase.json` to have a `source` option, rather\nthan a `public` option. For example: \n\n {\n \"hosting\": {\n \"source\": \"./path-to-your-flutter-app\"\n }\n }\n\nServe static content\n\nAfter initializing Firebase, you can serve static content with the standard\ndeployment command: \n\n firebase deploy"]]