Ionic 6 Full Starter App
IonicThemesBuy NOWLive Preview
  • What is Ionic 6 Full Starter App?
  • About this Ionic template
  • Template versions
  • Set up the development environment
  • Running the Ionic app
  • How to use this template?
  • Ionic Capacitor
  • Ionic Code Structure
  • Ionic Data Integration
  • Theming
  • Ionic Progressive Web App
  • Ionic Navigation
  • Ionic Server Side Rendering (SSR)
  • Ionic Splash Screens and Icons
  • App Shell
    • Image Shell
    • Text Shell
    • Aspect Ratio
  • Ionic Custom Components
    • Checkbox Wrapper
    • Countdown timer
    • Ionic Show/Hide Password
  • Ionic Walkthrough (or tutorial)
  • Categories
  • Ionic Firebase Integration
    • Firebase Authentication
    • Firebase CRUD
    • Firebase Hosting
    • Push Notifications
  • Google Maps & Geolocation
  • Ionic Video Playlist
  • Ionic Multi Language
  • Getting Started
  • Ionic Authentication
  • Ionic Side Menu
  • Ionic Profile
  • Contact Card
  • Social Sharing
  • Ionic Notifications
  • Forms and Validations
  • Filters
  • FAQs
  • Common Errors and Solutions
  • Glossary
  • Upcoming features
  • 🧐Changelog
  • Reviews / Testimonials ⭐️⭐️⭐️⭐️⭐️
Powered by GitBook
On this page
  • Deploy your Ionic app with Firebase Hosting
  • Add Firebase to your Ionic App

Was this helpful?

  1. Ionic Firebase Integration

Firebase Hosting

How to deploy you Ionic app using Firebase Hosting.

PreviousFirebase CRUDNextPush Notifications

Last updated 3 years ago

Was this helpful?

Deploy your Ionic app with Firebase Hosting

Firebase provides a Hosting solution that's super easy to work with besides it is free and has many benefits for Progressive Web Apps, including fast response times thanks to CDN's, HTTPS enabled by default, and support for HTTP2 push.

Follow me while I show you how to deploy your Ionic app to Firebase.

If you want to learn more about using , check our series of posts covering , , , .

Add Firebase to your Ionic App

Let’s start by installing the Firebase CLI:

npm install -g firebase-tools

With the Firebase CLI installed, run firebase init from within your project’s folder. This will generate a firebase.json config file for you to adjust the deployment details.

Lastly, make sure caching headers are being set correctly. Ensure your firebase.json file looks like this:

firebase.json
{
  "hosting": {
    "public": "www",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [ {
      "source": "**",
      "destination": "/index.html"
    } ],
    "headers": [
      {
        "source": "**",
        "headers": [
          {
            "key": "Cache-Control",
            "value": "no-cache, no-store, must-revalidate"
          }
        ]
      },
      {
        "source": "**/*.@(jpg|jpeg|gif|png|svg|webp|js|css|eot|otf|ttf|ttc|woff|font.css)",
        "headers": [
          {
            "key": "Cache-Control",
            "value": "no-cache"
          }
        ]
      },
      {
        "source": "ngsw-worker.js",
        "headers": [
          {
            "key": "Cache-Control",
            "value": "no-cache"
          }
        ]
      }
    ]
  }
}

Now each time you make a change on your Ionic app run the following:

ionic build --prod

That’s it! Now simply deploy the app by running:

firebase deploy
Firebase with Ionic Apps
Authentication with Firebase
Ionic CRUD with Firebase
Firebase Storage
Firebase Database
Ionic Firebase deploy