Introduction:There is a lot of free web hosting providers on the internet. Most of them will suspend our A/c after getting some amount of visitors, or they will show ads on our website. Showing Ads under our company or personal website will make lose our site reputation. We always trust Google right? Yes then, host your new static website under their Firebase Free Hosting. Today We are going to learn to host a static website under Google Firebase.
What is Firebase?Firebase is a mobile platform that helps you quickly develop high-quality apps, grow your user base, and earn more money. Firebase is made up of complementary features that you can mix-and-match to fit your needs.
Firebase mainly using while creating mobile applications such as Android App, IOS App, Windows App, Etc. It will provide free database and other hosting services to support the App. So developers who don't have a web server can use the Firebase as their App database and Hosting service. The main advantage of Firebase is, It will provide Real Time Sync and scalable Database Structure.
How to Create Website Using Google Firebase Hosting:To host a website in Firebase, You needed an A/c in Google and linked with https://firebase.google.com/ . Once you liked with the Firebase. You can "Get Started For Free". Now follow the steps to host your first site.
- Once you log-in to your A/c provided by Firebase. Click on the "Create New Project" Button in blue color.
- After you name your first project, Click on the "Create Project" Button to complete the action. Once you fill out the work, You will be taken to the Dashboard.
- Inside the Dashboard, you can see the "Hosting" Tab under the "Develop" Section which located on the left side. Click on it and you will reach the step to host your first website with Firebase service.
- Click on the "Get Started" Blue button.
- https://nodejs.org/en/ - Go to this link address to download Node.JS.
$ npm install -g firebase-tools
- Once the action finished. You have to log intoF your A/c. For that, you have to execute the following command on the command line.
$ firebase login
- Now you need to initiate your project by executing the command that given below.
$ firebase init
- The "Init" Command will ask you further questions. You can use the below image as a reference to answer the question.
- Once you finished the above Initialisation Process. The final step is to complete the process by publishing the site.
- You can make changes on the index page which located inside the "Public" Directory in your project folder.
- You can also create new pages and link them each other.
- After doing the changes that you require on the pages. Execute the below command to finish the process.
$ firebase deploy
- You are done. Once you published the site, The command line window will show you the link to access it via a web browser.
- You can also grab the link address from the "Dash Board".
- You can connect own domain by click on the "Connect Custom Domain" Button. It will ask you to enter the domain, and it will ask you to add TXT Record in your domain control panel. Once you finish the process, it will take 24 Hours to change the domain DNS updating process. Once it finished. Your site will go live.
Suggested Articles for Webmasters:
- Create Own Live Cricket Score Website Using PHP API Script.
- How to Use Google GEO Location API to Get User Current Location.
- PHP Script to Autocomplete Textbox Using Ajax and Jquery.
- How to Stop Wordpress Asking FTP Login Credential.