DEV Community

Cover image for HOSTING BLOGS AND PORTFOLIOS ON AWS S3
tolulope victor
tolulope victor

Posted on

HOSTING BLOGS AND PORTFOLIOS ON AWS S3

In today’s digital landscape, having a reliable and cost-effective platform to host blogs and portfolios is essential for individuals and small businesses. Amazon Web Services (AWS) Simple Storage Service (S3) offers an innovative solution for hosting static websites that are both scalable and budget-friendly. Whether you’re a freelancer showcasing your portfolio or a blogger sharing your thoughts with the world, AWS S3 provides a secure and straightforward way to make your content accessible globally.

This article will guide you through the process of using AWS S3 to host static blogs and portfolios. You’ll learn how to set up a static website, upload your content, and ensure your site is available to users everywhere. With AWS S3, you can focus on creating exceptional content while AWS handles the hosting seamlessly.

STEP 1 Create an AWS account: My previous article discussed how to set a cost-effective AWS account use this link:[https://t.co/bB4cYriWCc]

_STEP 2_Create an S3 bucket
Image description
An S3 bucket is a storage container in Amazon Web Services (AWS) Simple Storage Service (S3) used to store and manage data objects such as files, images, and backups. Think of it as a "folder" in the cloud, though it does not have a hierarchical structure like traditional file systems.

  • Go to Amazon S3 from the Services menu
  • Click on Create bucket
  • Give your bucket a unique name (each bucket name must be globally unique)

For this tutorial, you can leave the remaining options as defaults and click Create bucket.

Image description

Image description

noteThe bucket name will be used as the website's domain, so choose something descriptive and relevant.

Image description

Step 3Enable Static Website

  • Click on the bucket created to navigate the PROPERTIES TAB
    Image description

  • Scroll down to Static website hosting and select "Edit"

  • Choose Enable and select Host a static website

Image description

Image description

  • Choose Enable and select Host a static website

  • In the Index document field, enter index.html (or the name of your main file)

  • For an optional Error document field, you can specify an error page like error.html

Image description
At the end of the page, click 'Save Changes'
STEP 4 Upload Your Website Files

  • In your S3 bucket, go to the Objects tab

Click Upload and select the files you want to upload (e.g., index.html, styles.css, script.js, images). In our case it's an HTML website.

  • Click Upload to add the files to your bucket

Image description
Note: For this article, I used HTML source code obtained from tooplate.com and saved it as 'index.html' for our S3 object file.
Click on the "add file", select your file scroll down to use the UPLOAD button

Image description

Top comments (0)