Free website hosting #3 – Firebase

This is part 3 of a series detailing the steps required to obtain free hosting on a modern cloud provider.

In this part we take a look at Google Firebase. The documentation for this process is already really good, so this document will just be a summary.

Step 1 – Login or create a Google account

If you have a Google login, you can use it, or create a new one.

Step 2 – create a project

Within Firebase all related resources are contained within a project, so this must be created first.

  • Click Add project
  • Enter a unique Project name – this must be unique to your login. If the name is also unique within Firebase the Project ID will match the Project name, otherwise a suffix will be automatically added.
  • Check the boxes, and click Create project

Step 3 – create a hosting resource

Within the application a hosting resource is created.

  • Within the project select Hosting | Get started
Roll your sleeves up… you need to open a console…

This is where you need to roll your sleeves up. Your Firebase web application is mostly controlled via a Command Line Interface (CLI). You need to use NPM, which which should be automatically installed with Node.js

Open a command line (windows) or terminal window (mac) in a suitable folder and use the CLI to create your Firebase hosting resource. Copy the install command from the browser and paste it into the CLI and hit Enter.

NOTE: you will need Admin or sudo permissions to complete this.

  • npm install -g firebase-tools
  • firebase login
  • firebase init
  • firebase deploy

You should now have a working demo website.

The default webpage that is created during firebase init

To make sure this is the correct content, you must now copy all the files and folders from your website into the public folder and run firebase deploy again.

Hello free world!

Summary

IMHO Firebase has the best documentation that I’ve seen, and if you are comfortable with the CLI then it’s all pretty straight forward. However, if you are not at home in the terminal, then the CLI will be very intimidating to most non-developers.

There isn’t yet a built in story for deploying from source either, which I think is a mistake on the part of the Google team. Git is so ubiquitous now that this should be available by default. Deploying via a repository also enforces development “best-practices” such as source control and CI.

There is an excellent Firecast on how to deploy via Travis CI, but adding another dependency into the mix doesn’t sit well with me – it is adding unnecessary sprawl and complexity.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

A WordPress.com Website.

Up ↑

%d bloggers like this: