DEV Community

Cover image for Serverless for Beginners: Hosting a Static Website on Cloud Storage for $0/month
EugeneTW
EugeneTW

Posted on

Serverless for Beginners: Hosting a Static Website on Cloud Storage for $0/month

Hey devs! πŸ‘‹

When learning the cloud, many beginners start by launching a Virtual Machine (like EC2) to host a website. However, for static sites, managing a server is completely unnecessary!

In this guide, I'll show you how to host a static website using Cloud Object Storage (AWS S3 / GCP Cloud Storage / Azure Blob) in just 5 minutes. It’s maintenance-free and practically free!

πŸ› οΈ Step-by-Step Setup:

Prepare Your HTML File: Create a simple index.html file on your local machine.

Create a Storage Bucket: Go to your cloud console and create a new bucket.

Enable Static Website Hosting: Navigate to the bucket settings and enable the Static Website Hosting option, specifying index.html as the index document.

Configure Public Access: Adjust bucket permissions and policy to allow public read access for hosted files.

Upload & Launch: Upload index.html, grab the generated bucket endpoint URL, and test it in your browser!

πŸ’¬ Wrap Up

Deploying a site without touching Linux servers or Nginx configurations felt like magic! It’s the perfect first hands-on project for cloud beginners.

What was your very first project when learning AWS or GCP? Let me know in the comments below!

Top comments (0)