> For the complete documentation index, see [llms.txt](https://docs.ionicfirebaseapp.com/flutter-multirestaurant-app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionicfirebaseapp.com/flutter-multirestaurant-app/firebase-deployment.md).

# Firebase deployment

## Firebase Cli Installation <a href="#firebase-cli-installation" id="firebase-cli-installation"></a>

‌

You can [create a firebase project](https://docs.ionicfirebaseapp.com/multirestaurantfirestorebackend/firebase-config) through firebase console before the web app deployment on their Hosting. Once your project gets create Please install the firebase-cli globally on your machine.

```
$     npm install -g firebase-tools   
```

‌

Once above command finish and firebase-cli install on your machine you can check if installation successfully finished or not .

```
$  firebase --version   // it will return the firebase version 
```

‌

## Firebase Hosting Init <a href="#firebase-hosting-init" id="firebase-hosting-init"></a>

‌

You need to navigate to web app directory

​‌

![](https://gblobscdn.gitbook.com/assets%2F-LD0Q9Laf5be7GA-f2fQ%2F-LMaTLHquF_BTNZ61skc%2F-LMa_AjMob-vHqbeXNjI%2Ffirebase_init.png?alt=media\&token=cf6a8e96-32a4-4fb8-aeeb-8b01ca4136f2)

Once you navigate into webapp directory run following command.

```
$ firebase init   // it will initialize firebase project  
```

‌

If you are first time then it will ask to login in your google account. You can also run login command manually.

```
$ firebase login     // Will promopt to login with your gmail account 
```

​‌

![](https://gblobscdn.gitbook.com/assets%2F-LD0Q9Laf5be7GA-f2fQ%2F-LMaTLHquF_BTNZ61skc%2F-LMasZK_hLfR3GwTlvpV%2Ffirebase_hosting_selection.png?alt=media\&token=32dd50fc-aab4-4044-b119-58118fb589b3)

After `firebase init`‌

You can the list of services firebase has like above screen , Their you can select ***function and Hosting OR HOSTING*** and hit Enter. it will initialize you firebase project in existing folder. You can use Arrow Key UP or DOWN with TAB key to select the list .‌

Once you selected Hosting and function just hit then Enter and then it will show the list of project in your account and you can select the firebase app where you want this app to deploy​‌

![](https://gblobscdn.gitbook.com/assets%2F-LD0Q9Laf5be7GA-f2fQ%2F-LMaTLHquF_BTNZ61skc%2F-LMavBiu0sNlYtgiBCoY%2Fselect_project.png?alt=media\&token=8140364d-e936-449b-98f8-db56689fa371)

Once you select firebase app name from list it may ask for some more question for Function to deploy on same project . We used firebase cloud function on some functionality where client can't handle the logic properly like rating , loyalty point etc.​‌

![](https://gblobscdn.gitbook.com/assets%2F-LD0Q9Laf5be7GA-f2fQ%2F-LMaTLHquF_BTNZ61skc%2F-LMawKrOd_1HjXH2d4zI%2Ffirebase_function_question.png?alt=media\&token=bdfb7f5a-b625-4042-b9b6-9acf628ac020)

Once project initialize it will create 2 folder files in your project directory.

```
.firebaserc and firebase.json 
```

‌

**.firebaserc :** it keep the name of the firebase project . You can change there name if want to use some other firebase app .

```
{  "projects": {    "default": "multirestaurant-test"  }}
```

‌

In our project probably these files already created so you can just need to change project name to your own project and we are ready to go .‌

Let's make a production build now

```
$ ng build --prod  // run in project directory 
```

‌

&#x20;It will create a dist directory that can upload on any hosting providers but to deploy on firebase we run the follwing command .

```
$ firebase deploy  
```

‌

It will deploy all the dist files to your firebase hosting account . Function also get deployed on your account as well . Inside function Directory please install modules as well .​‌

![](https://gblobscdn.gitbook.com/assets%2F-LD0Q9Laf5be7GA-f2fQ%2F-LMaTLHquF_BTNZ61skc%2F-LMayWV1aEr4yyS--hLm%2Ffunction-deployment.png?alt=media\&token=8b81aba7-940d-4f14-a9ce-3b1fe29ebca6)

Once all goes well you can visit your firebase console window and check hosting and function if deployed or not .

​‌

![](https://gblobscdn.gitbook.com/assets%2F-LD0Q9Laf5be7GA-f2fQ%2F-LMaTLHquF_BTNZ61skc%2F-LMazMOh-bPhfuizNevR%2Ffirebase_hosting.png?alt=media\&token=944eda4d-754a-4f9e-a6a5-066e9333330b)

You can connect your firebase hosting with your domain as well . You need to update your DNS.

​‌

![](https://gblobscdn.gitbook.com/assets%2F-LD0Q9Laf5be7GA-f2fQ%2F-LMaTLHquF_BTNZ61skc%2F-LMazdNFKujuSFIK43xk%2Ffirebase-function.png?alt=media\&token=8a06bb1f-41f6-4b5c-a0af-469ecc10c76c)

Once firebase deployment success your firebase console will be looked like above screen. To deploy function you need to Upgrade your account to paid version like Spark .‌

If you have any issue can follow [Google Firebase](https://firebase.google.com/docs/cli/) docs on deployment .


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ionicfirebaseapp.com/flutter-multirestaurant-app/firebase-deployment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
