Hosting a Website in Seconds : A Step-by-Step Guide to Using Amazon AWS S3 Serverless Platform

Prabir Kalwani
5 min readAug 16, 2023

--

Being a novice programmer, I’m captivated by websites . While creating digital realms feels natural, a key question arises: how do I share these websites online?

This is the start of a series that aims to make web hosting easy to understand. We’ll start with the basics, move to more advanced topics, and finally explore the detailed world of web hosting. The series will guide you through the basics and then into more complicated aspects step by step

In this article , we embark on a journey learning of web hosting, ushering you through each stage, each concept, and each practice. From the rudimentary building blocks to the more sophisticated mechanics, I’ll provide you with a comprehensive understanding of hosting websites using AWS S3, ensuring that by the series’ end, you’ll have traversed the entire A-to-Z spectrum of web hosting.

So, what exactly is AWS ?

Think of AWS (Amazon Web Services) as owning land or property, but in the digital world. When you own property in a country, you have your own space where you can build things, such as a house or a workshop. Similarly, in the digital realm, when you use AWS, you’re essentially “owning” a space on their cloud platform where you can set up and run various types of digital tools and services.

Imagine you’re a craftsman who needs a place to build things. Instead of constructing your own workshop from scratch, which can take a lot of time and resources, you decide to lease a ready-made workshop in a business park. This workshop comes fully equipped with tools, machinery, and utilities, and you only pay for what you use. Plus, if you ever need more space or specialised equipment, you can easily upgrade your workshop without the hassle of building or maintaining it yourself.

This map illustrates the locations of AWS data centers where your website will be hosted.

Prerequisites :

AWS account :- If you Dont have an AWS account , click here to register

Getting Started :

Let’s begin by organising your website files into a dedicated folder. This beginner-friendly tutorial will cover HTML and CSS hosting, while the next tutorial will delve into hosting with React JS — so keep an eye out for that.

If you’re currently without HTML files, don’t fret. We’ve prepared demo files for you, accessible through this GitHub link. Click here to access them and enrich your learning journey.

For the people using GitHub for the files :-

Clone the Github Repository to your local machine by the command below

git clone https://github.com/PrabirKalwani/404page.git
git cloning the repo

Create A S3 Bucket:-

  1. Access your AWS dashboard and locate the S3 (Simple Storage Service) through the search function. Once you’re on the S3 dashboard, continue with the next steps.
  2. Navigate to the left-hand side and select “Buckets.” Proceed by clicking on the “Create Bucket” option, highlighted in yellow.
    Think of a bucket as analogous to a Google Drive, where you can store your website files.
  3. Moving forward, configure the bucket with general settings. Employ your domain name as the bucket name, as this setup will be employed for hosting purposes. If you lack a domain name, feel free to use a name of your preference.
  4. Subsequently, click on “ACLs” to enable Access Control Lists (ACLs). More about ACLS here
  5. It’s advisable to choose the region closest to your location. This reduces website latency and eliminates the need for a Content Delivery Network (CDN). Further details about CDNs will be covered in the upcoming article.
  6. Within this setup, opt to grant unrestricted access to the bucket.
  7. Subsequently, proceed to create your bucket by clicking the designated button. For a comprehensive walkthrough, a video outlining the entire process is provided below.

While it’s recommended to carefully review each security rule for enhanced safety, for the sake of efficiency, we’re proceeding with permitting public access for now.

Make The Bucket Ready For Hosting

  1. Following this, proceed to upload all your files and directories to your S3 bucket
  2. Select the checkbox to highlight all files and folders. Then, access the “Actions” menu and choose the option to make them public by utilizing the ACL feature.

Host Your Files

Navigate to the upper section and select “Properties.” Proceed to scroll down to the “Static Website Hosting” option. Activate this feature and proceed to input the name of your primary HTML file in the designated “Index Document” tab.

Subsequently, return to the properties tab where you’ll find a prepared link for your website.

Conclusion

In conclusion, Amazon S3 offers an accessible hosting solution with user-friendly features. However, this convenience comes at the cost of potential security vulnerabilities.

On the positive side, it simplifies file management and accommodates varying traffic levels while being cost-effective and ensuring high availability.

Conversely, limitations in customization, security measures, absence of server-side scripting, and potential performance constraints should be considered.

Deciding on Amazon S3 as a hosting solution requires weighing its ease of use against its security and functionality trade-offs, depending on your project’s specific requirements.

The subsequent pair of articles will explore the implementation of Server Hosting through NGINX Proxy Manager, Docker, AWS EC2, SSL Certificates, and Cloudflare.

This approach offers several advantages, including enhanced security, scalability, streamlined management through Docker, reliable SSL encryption, and improved performance through Cloudflare’s content delivery network.

Feel Free to react out to me if you have any feedback / queries

Special Thanks to Darsh Mashru and Aryan Irani for inspiring me to write this article

References:-

--

--

Prabir Kalwani

Curious scholar pursuing Tech and MBA. Committed to innovation, sustainability, adept in advanced web tech like ReactJS, MERN, MEAN.