DEV Community

Cover image for Hosting your website with Firebase🔥
Gaute Meek Olsen
Gaute Meek Olsen

Posted on • Edited on • Originally published at gaute.dev

Hosting your website with Firebase🔥

I love how easy it is to host a website with Firebase.

Set up

Create a project in the Firebase console by just a few clicks.

If you haven't used firebase before, install the cli and login:

npm i -g firebase-tools
firebase login
Enter fullscreen mode Exit fullscreen mode

Then initiate your project:

firebase init
Enter fullscreen mode Exit fullscreen mode

Select "Hosting" with space then enter. Then select the project created in the Firebase console. Then enter the path to the folder your index.html file is located (i.e. public). If you have a single-page app and want all urls to point to index.html select yes.

Deploy

firebase deploy
Enter fullscreen mode Exit fullscreen mode

Congratulations, you have now hosted your website. You will find your page as a subdomain of firebaseapp.com and web.app. Like this https://projectid.firebaseapp.com and https://projectid.web.app. If you need your own domain, just go to Hosting in the firebase console and press the Connect domain button. Each time you need to update the content, just make the changes and hit firebase deploy again.

Check out Firebase for more information.

Conclusion

firebase init
firebase deploy
Enter fullscreen mode Exit fullscreen mode

That's all, thank you for reading 🔥💙

This article is part of Hosting a Website series, I usually choose Firebase when I want to deploy manually or are using other Firebase products and Netlify if I want CD (continuous delivery). Though both manually and CD is possible to achieve with both of them.

Top comments (1)

Collapse
 
myousufsoomro profile image
M Yousuf Soomro

Wow.. Amazing!! 👍

Also, look out my tutorial video of Firebase Hosting 🔥

▶️ youtu.be/18IeHaoapv0