As I continue learning cloud computing and getting hands-on with AWS, I decided to host a simple static website using Amazon S3. Since my website only contains HTML and CSS, S3’s static website hosting was the perfect solution—no need for servers or backend configurations. In this article, I’ll share exactly how I set it up using the AWS Management Console.
Why I Chose Amazon S3
I wanted a cost-effective and easy-to-manage way to host a simple website. After researching different hosting options, S3 stood out because:
- It's affordable-I only pay for what I use.
- It's easy to set up-no need to configure web servers.
- It's scalable-AWS handles traffic fluctuations automatically.
With that in mind, I jumped right into the setup.
Step 1: Creating an S3 Bucket
1. Logging into AWS
First, I logged into the AWS Management Console and searched for S3
in the AWS services menu.
2. Creating the Bucket
- Clicked "Create bucket".
- Selected my preferred AWS region.
- Disabled "Block all public access" (since I wanted my website to be
public).
- Clicked "Create bucket" to finish the setup.
At this point, my storage space was ready, but I still needed to upload my website files.
Step 2: Uploading My Website Files
- Opened my new S3 bucket.
- Clicked "Upload".
- Clicked "Add files" and selected my index.html and image
folder.
- Clicked "Upload" to store them in S3.
Now, my files were in the cloud, but the website wasn’t live yet.
Step 3: Enabling Static Website Hosting
To make my website accessible via a URL, I had to enable static website hosting:
- Opened the Properties tab in my S3 bucket.
- Scrolled down to Static website hosting and clicked Edit.
- Selected "Enable".
- Chose "Host a static website".
- Entered s3.html as my Index document.
- Clicked Save changes.
After enabling this, AWS provided me with a website endpoint URL, something like this: http://stephenbucket.s3.us-east-1.amazonaws.com/s3.html
However, when I tried opening the link, I got an Access Denied error. That meant I needed to allow public access to my files.
Step 4: Making My Website Public
By default, all S3 files are private, so I had to update permissions.
1. Adjusting Bucket Permissions
- Opened the Permissions tab in my S3 bucket.
- Clicked Edit under Block public access settings.
- Unchecked "Block all public access".
- Confirmed the change by typing confirm and clicked Save changes.
2. Changing Object Permissions
Even though I updated the bucket settings, my files were still private. I had to manually make them public:
- Went back to the Objects tab.
- Selected my s3.html file.
- Clicked "Actions" > "Make public".
Now, my website was accessible to the public!
Step 5: Testing My Website
To verify everything was working, I:
- Opened a browser.
- Pasted the S3 website URL from Step 3.
- Saw my website load successfully!
It was a great feeling to see my work live on the internet, hosted entirely on AWS.
Final Thoughts
Hosting a static website on S3 was a smooth experience, and I learned a lot about AWS in the process. The AWS Management Console made it easy to:
- Create and configure an S3 bucket.
- Upload and manage website files.
- Enable public access for website hosting.
If you’re also exploring AWS, I highly recommend trying this out. It’s a simple yet powerful way to get hands-on cloud experience.
Top comments (0)