Firebase Hosting | How to deploy your website on Firebase
1. Download and install the Node.js.
2. Open Spotlight Search. Press Command(cmd) + Space.
3. Run the Terminal.
4. Run the following cURL command (to install firebase CLI)
curl -sL https://firebase.tools | bash
5. Open Finder.
6. Press Command(cmd) + Shift + G
7. Enter /usr/local/bin
8. Ensure that firebase, npm and npx files exist.
9. Go back Terminal and run the following command to log in firebase
firebase login
10. Run the following command to initialize.
firebase init
11. Select “Hosting” by using Space Bar button.
12. Select “Use an exist project” if you have or “Create a new project”
13. Select your exist project. ( or firstly create a firebase project from firebase console and then integrate it into your website )
14.For example write “Y” as folder name. It’ created below.
15. Ensure that “Y” folder is created. Open finder, press command + shift + g then /users/(your user like below). You will see the “Y” folder there.
16. Type “N”
17. Initialization completed.
18. Now copy all your web project (js, css, html files etc.) into “Y” folder that we created ( via firebase CLI / Terminal above).
19. And finally run the following command to deploy your project into firebase.
firebase deploy
20. Finally, you can copy the following “Hosting URL” then paste in browser url bar and go.
Congratulations.
You have a website now :)
-
If you prefer to use your domain address how can you connect a custom domain address to your firebase web project?
- Open console.firebase.google.com then on the left menu click the Hosting button
2. Click “Add Custom Domain” button.
3. Enter your own domain address.
4. Copy the “txt” value.
5. Now go to your domain dns settings on console of domain provider. For example “go daddy”.
6. Go to “Dns Settings”
6. Click the “Add” button.
7. Add a “txt” record value into dns settings. And Save it.
8. Then go back to firebase console and click “Add” for www. version.
9. Copy the “A” record values from firebase console.
10. Similarly, add to your dns settings two “A” record that you copied from firebase console. And save it in go daddy > dns settings > as a new A record.
That’s all. It takes a while due to the server processing.
Approximately, 4/5 hours later your domain address will be connected.