There’s something empowering about learning you can host your very own website on Google Cloud for free, even if you’ve never touched a clou...
There’s something empowering about learning you can host your very own website on Google Cloud for free, even if you’ve never touched a cloud server before—because with a few careful steps, just a bit of patience, and a observance to learn and follow along, you can spin up a virtual machine using Google Cloud’s always-free tier, install Docker, set up a secure web server with Caddy, and connect your site to a custom domain with HTTPS, all without worrying about hidden charges or accidentally racking up a bill you didn’t expect, as long as you pay attention to the resource limits I’ll break down for you along the way.
To kick things off, you’ll want to head over to cloud.google.com—yes, you’ll need a credit card to sign up, but don’t stress, because as long as you stick to the “always free” tier (which I’ll help you configure), you won’t be charged a cent, and you can always double-check the resource parameters on Google’s documentation or my blog post linked below for extra peace of mind. Once you’re in the Google Cloud Console, just tap the hamburger menu in the top left, find “Compute Engine,” and click through to “Overview,” then look for the “Create Instance” button; first-timers might have to enable the Compute Engine API, but that’s just a one-time step before you can start configuring your virtual machine.
Here’s where paying attention to the details really matters: to stay free, select an E2 Micro machine (which gives you two virtual CPUs and 1 GB of memory) and make sure you pick a supported region like US Central 1 (Iowa); then, for your operating system, I recommend Ubuntu 24.04 LTS (the x86/64 version, not ARM), and for storage, you can use up to 30 GB of standard SSD at no cost as part of the free tier, so choose “standard persistent disk” and you’re set. While customizing, skip backups and advanced monitoring to avoid extra fees, make sure HTTP and HTTPS traffic is enabled in networking, and keep the network service tier on “Premium”—even though it might seem like switching to “Standard” would grant more bandwidth, that’s only for paid instances, so you’re still limited to 1 GB of outgoing traffic per month under the free plan.
As you complete the setup, select “standard” as your provisioning model (not “spot,” which is preemptible and not eligible for the free tier), and when you review the summary, you’ll probably see an estimated cost (maybe $7 or so), but don’t let this worry you, as this is just a projection for paid configurations—stick to the E2 Micro in a supported region with 30 GB SSD and you’re good to go. Once you hit “Create,” your virtual machine will launch in a few minutes, and you’ll be able to connect via SSH (right in your browser) after authorizing your Google account.
With your VM running, you’ll install Docker and Docker Compose—a single command will fetch and run the install script (all commands are on my website for easy copy-pasting), then you’ll add your user to the Docker group so you don’t need to type “sudo” every time, and after a quick session restart, you’re ready to build your site. Create a directory for your website, add a basic docker-compose.yml file that pulls the Caddy web server image, exposes ports 80 and 443, and runs in the background, and just like that, you’re technically hosting a site at your machine’s external IP address (though for now, it’s just Caddy’s default landing page, and not yet secured or connected to your domain).
To level up, you’ll want to point your own domain name to the VM’s IP address—just add A Records (for both “@” and “www” if you like) in your registrar’s DNS settings pointing to your VM’s external IP, and once DNS propagates, you can configure Caddy to serve your website on that domain. Edit a Caddyfile that specifies your domain and the root directory for static files, create a simple index.html (a big header, a short paragraph, maybe a link), update your docker-compose.yml to mount both the website directory and Caddyfile as volumes, and restart your container so the changes take effect.
Now, when you visit your domain in the browser (try with https:// to check the auto-enabled SSL), you’ll find your styled homepage live on the public internet, running from your Google Cloud VM—no cost, no catch, as long as you respect the free tier limits. The main restriction to watch is that 1 GB cap on outbound data each month; if your home page is about 2 MB, you’ll get roughly 500 page views before incurring charges (extra bandwidth is just $0.12 per GB, but it can add up with higher traffic). To squeeze more from your free tier, use a free CDN like Cloudflare, which can cache and serve content, easily letting you scale to several thousand monthly page views without breaking the bank.
If you ever outgrow these limits or want to explore alternative free hosting methods, check out my other videos and the up-to-date list on my website, where you’ll find dozens of ways to put your site on the web for free or very little cost. All the commands, configuration files, and extra resources are linked below and on my site, so you can follow along without missing a step. Thanks for reading—give this a try, experiment with your own content, and see just how easy it is to launch a secure, custom website in the cloud, even if you’re starting from scratch.
To kick things off, you’ll want to head over to cloud.google.com—yes, you’ll need a credit card to sign up, but don’t stress, because as long as you stick to the “always free” tier (which I’ll help you configure), you won’t be charged a cent, and you can always double-check the resource parameters on Google’s documentation or my blog post linked below for extra peace of mind. Once you’re in the Google Cloud Console, just tap the hamburger menu in the top left, find “Compute Engine,” and click through to “Overview,” then look for the “Create Instance” button; first-timers might have to enable the Compute Engine API, but that’s just a one-time step before you can start configuring your virtual machine.
Here’s where paying attention to the details really matters: to stay free, select an E2 Micro machine (which gives you two virtual CPUs and 1 GB of memory) and make sure you pick a supported region like US Central 1 (Iowa); then, for your operating system, I recommend Ubuntu 24.04 LTS (the x86/64 version, not ARM), and for storage, you can use up to 30 GB of standard SSD at no cost as part of the free tier, so choose “standard persistent disk” and you’re set. While customizing, skip backups and advanced monitoring to avoid extra fees, make sure HTTP and HTTPS traffic is enabled in networking, and keep the network service tier on “Premium”—even though it might seem like switching to “Standard” would grant more bandwidth, that’s only for paid instances, so you’re still limited to 1 GB of outgoing traffic per month under the free plan.
As you complete the setup, select “standard” as your provisioning model (not “spot,” which is preemptible and not eligible for the free tier), and when you review the summary, you’ll probably see an estimated cost (maybe $7 or so), but don’t let this worry you, as this is just a projection for paid configurations—stick to the E2 Micro in a supported region with 30 GB SSD and you’re good to go. Once you hit “Create,” your virtual machine will launch in a few minutes, and you’ll be able to connect via SSH (right in your browser) after authorizing your Google account.
With your VM running, you’ll install Docker and Docker Compose—a single command will fetch and run the install script (all commands are on my website for easy copy-pasting), then you’ll add your user to the Docker group so you don’t need to type “sudo” every time, and after a quick session restart, you’re ready to build your site. Create a directory for your website, add a basic docker-compose.yml file that pulls the Caddy web server image, exposes ports 80 and 443, and runs in the background, and just like that, you’re technically hosting a site at your machine’s external IP address (though for now, it’s just Caddy’s default landing page, and not yet secured or connected to your domain).
To level up, you’ll want to point your own domain name to the VM’s IP address—just add A Records (for both “@” and “www” if you like) in your registrar’s DNS settings pointing to your VM’s external IP, and once DNS propagates, you can configure Caddy to serve your website on that domain. Edit a Caddyfile that specifies your domain and the root directory for static files, create a simple index.html (a big header, a short paragraph, maybe a link), update your docker-compose.yml to mount both the website directory and Caddyfile as volumes, and restart your container so the changes take effect.
Now, when you visit your domain in the browser (try with https:// to check the auto-enabled SSL), you’ll find your styled homepage live on the public internet, running from your Google Cloud VM—no cost, no catch, as long as you respect the free tier limits. The main restriction to watch is that 1 GB cap on outbound data each month; if your home page is about 2 MB, you’ll get roughly 500 page views before incurring charges (extra bandwidth is just $0.12 per GB, but it can add up with higher traffic). To squeeze more from your free tier, use a free CDN like Cloudflare, which can cache and serve content, easily letting you scale to several thousand monthly page views without breaking the bank.
If you ever outgrow these limits or want to explore alternative free hosting methods, check out my other videos and the up-to-date list on my website, where you’ll find dozens of ways to put your site on the web for free or very little cost. All the commands, configuration files, and extra resources are linked below and on my site, so you can follow along without missing a step. Thanks for reading—give this a try, experiment with your own content, and see just how easy it is to launch a secure, custom website in the cloud, even if you’re starting from scratch.
.png)
COMMENTS