Do it yourself

How to Build a Web Server on Google Cloud’s Free Tier almost free (Hopefully)

Welcome to the Land of Free Space – (almost)

Starting your web development journey can feel like riding a unicycle on a tightrope: exciting, a little terrifying, and almost guaranteed to involve a few bruises. But fear not! Google Cloud’s Free Tier is here to save the day (and your wallet) by letting you host a web server for free. Well, mostly free—you might owe Google a “what’s in your pocket” fee if you’re not careful. Let’s explore how to get started while avoiding the financial landmines.

Step 1: Sign Up Without Selling Your Soul

First, you’ll need a Google Cloud account. Google generously offers a $300 free trial, which sounds amazing until you remember the “free tier” part doesn’t really count against this credit. Pro tip: Don’t treat the $300 like Monopoly money unless you’re building a server farm for “Cats Wearing Hats” memes.

First go to https://cloud.google.com, click “Get Started,” and create a new account or use your existing account

Google asks for a credit card, but they promise not to charge you unless you deliberately go over the free tier limits. If they do, you’ll at least get a nice “Whoops, you’re broke now” email.

Step 2: Choose a Virtual Machine Instance

First create a project, enable Compue engine API, enable billing. Now it is time to pick your star player. Google’s Free Tier offers an e2-micro  instance, which is as powerful as a hamster on a wheel but perfect for beginner projects. It’s free in specific regions, so choose wisely. (Spoiler: Oregon: us-west1 is usually a safe bet.)

Navigate to the Compute Engine, click “Create Instance,” and select the e2-micro machine type.

Don’t accidentally pick a machine with names like “n1-mega-ultra” unless you’re aiming for “The Bill Heard Around the World.”

Step 3: Configure Your Server Without Breaking It

Now comes the fun part: setting up your web server. For this, you’ll likely want to use Ubuntu, because nothing screams “I’m learning” like Googling “Why is my Linux server not working?” every five minutes.

Select Ubuntu as your operating system and SSH into your instance. You can do it directly from linux terminal or use putty for windows (Hint: Google Cloud has a built-in SSH tool. No need to download a mysterious third-party app.)

SSH-ing to cloud

I prefer puTTygen for key generation. You can generate the private and public keys using PuTTygen and

Now once logged into ssh terminal and provided the credentials, execute following command

  sudo apt update && sudo apt install apache2 -y

Congratulations! You’ve just installed Apache, the software that will turn your server into the internet equivalent of an empty warehouse.

Forgetting to allow HTTP traffic in your firewall settings will result in hours of “Why is my website not loading?!” drama. Enable it under “Network settings” before blaming your Wi-Fi.

Step 4: Deploy a Simple Website (or Pretend You’re a Designer)

Your web server is up, but it’s currently a blank canvas. Time to flex those HTML muscles (or copy-paste someone else’s template; we won’t judge).

 1. Navigate to the default web directory:

     cd /var/www/html

  2. Replace the default `index.html` with your masterpiece:

     echo '<h1>Welcome to My Free Server!</h1>' > index.html

  3. Check your site by typing your server’s external IP into a browser. Boom, you’re live!

If you see a “403 Forbidden” page, remember: the server is not punishing you. Check file permissions and try again.

Step 5: Monitor Your Usage Like a Hawk

Google Cloud’s Free Tier is great, but it’s a bit like a stingy gym membership: overuse one service and you’ll be paying extra faster than you can say “scaling fees.”

Use the Google Cloud Console to monitor your usage. There’s a billing section that’s both useful and mildly terrifying.

Running too many processes on your f1-micro instance could lead to sluggish performance or shutdowns. Remember: it’s free because it’s limited.

Step 6: Brag About Your “Free” Server

Congratulations! You’ve set up a web server without spending a cent. Celebrate by showing your friends, family, or the barista who really didn’t ask about your tech projects.

The Free Lunch till it lasts

Google Cloud’s Free Tier is a fantastic resource for beginners who want to test their first or low traffic site without breaking the bank. While it’s not without its quirks (and fine print), it’s an excellent way to get hands-on experience with cloud computing. So go forth, build your web empire, and may your server always stay under budget!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.