AWS Lab Tutorial
Hosting a Static Website on AWS S3
This tutorial guides you through deploying a simple static website on Amazon S3, testing it, and
understanding the expected output.
Step 1: Create an S3 Bucket
1. Navigate to the S3 service.
2. Click Create bucket.
3. Enter a unique bucket name.
4. Uncheck Block all public access to allow public reads.
5. Leave other settings as default and click Create bucket. Your bucket is now ready to
store website files.
Step 2: Upload Website Files
1. In the S3 console, select your new bucket.
2. Click Upload.
3. Add your files: At minimum, upload an [Link] file (e.g., with basic HTML content like
Hello, World!).
4. Ensure files are uploaded successfully, check the bucket's Objects tab.
Step 3: Configure Static Website Hosting
1. In the bucket's Properties tab, scroll to Static website hosting.
2. Click Edit, then select Enable.
3. Set Hosting type to Host a static website.
4. Enter [Link] as the Index document.
5. Click Save changes.
6. Note the Bucket website endpoint (e.g., [Link] south-
[Link]). This is your site's URL.
Step 4: Set Permissions for Public Access
1. In the bucket's Permissions tab, scroll to Bucket policy.
2. Click Edit and paste this policy (replace your-bucket-name):
"Version": "2012-10-17",
"Statement": [
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::your-bucket-name/*"
3. Click Save changes. This allows public read access to objects.
If you encounter access issues, double-check that public access blocks are disabled in the
Permissions tab.
Step 5: Test the Website
1. Open a web browser and navigate to your bucket's endpoint (from Step 3).
2. If everything is set up correctly, your [Link] content should load.
3. Test navigation: If you have links or additional pages, click through them.
4. Check for issues: If you see an access denied error, verify the bucket policy and public
access settings.