<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Khaja Sabik Ahmed</title>
    <description>The latest articles on DEV Community by Khaja Sabik Ahmed (@khajasabik).</description>
    <link>https://dev.to/khajasabik</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1356127%2F9bd6b052-c351-4b73-b628-7bbe65ff5f82.jpg</url>
      <title>DEV Community: Khaja Sabik Ahmed</title>
      <link>https://dev.to/khajasabik</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/khajasabik"/>
    <language>en</language>
    <item>
      <title>Host Your Portfolio on Amazon S3: A Beginner's Guide to Static Website Hosting</title>
      <dc:creator>Khaja Sabik Ahmed</dc:creator>
      <pubDate>Tue, 18 Nov 2025 15:08:47 +0000</pubDate>
      <link>https://dev.to/khajasabik/host-your-portfolio-on-amazon-s3-a-beginners-guide-to-static-website-hosting-310l</link>
      <guid>https://dev.to/khajasabik/host-your-portfolio-on-amazon-s3-a-beginners-guide-to-static-website-hosting-310l</guid>
      <description>&lt;p&gt;&lt;strong&gt;Discover how to deploy your portfolio website using Amazon S3 static hosting — starting simple as a beginner, then scaling into a production-grade solution that can even support dynamic features as you grow.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpq2wjnw893hvjnj2b3tl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpq2wjnw893hvjnj2b3tl.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Amazon S3?
&lt;/h2&gt;

&lt;p&gt;Amazon Simple Storage Service (S3) is a scalable object storage service that allows you to store and retrieve data from anywhere on the web. Think of it like Google Drive or Dropbox, but programmable and highly scalable — perfect for hosting your portfolio website.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Durability&lt;/strong&gt;: 99.999999999% (yes, eleven 9s!) designed to protect against data loss across multiple facilities&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Availability&lt;/strong&gt;: 99.99% uptime ensures your portfolio is always online when opportunities knock&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: Store virtually unlimited data without worrying about capacity limits&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use Cases&lt;/strong&gt;: Website hosting, backups, application data storage, and much more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why choose S3 for your portfolio?&lt;/strong&gt; It's cost-effective (often just pennies per month), reliable, and gives you hands-on experience with cloud services that employers love to see on resumes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: Access the AWS Console
&lt;/h2&gt;

&lt;p&gt;Getting started is straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to the &lt;strong&gt;AWS Management Console&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;In the services search bar, type &lt;code&gt;S3&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;S3&lt;/strong&gt; to open the service&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo4loau07iu7xazvvduc5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo4loau07iu7xazvvduc5.png" alt=" " width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Create an S3 Bucket
&lt;/h2&gt;

&lt;p&gt;Your bucket is the container for your website files — think of it as your website's home on AWS:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Create bucket&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Configure the basic settings:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bucket name&lt;/strong&gt;: Must be globally unique across all AWS accounts (try something like &lt;code&gt;yourname-portfolio-2024&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS Region&lt;/strong&gt;: Choose &lt;code&gt;ap-southeast-1&lt;/code&gt; or your preferred region (pick one closest to your target audience for faster loading)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Object Ownership&lt;/strong&gt;, keep &lt;strong&gt;Block Public Access&lt;/strong&gt; enabled for now (we'll change this later)&lt;/li&gt;
&lt;li&gt;Leave other settings as default&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create bucket&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxerwv2alkcjfru7nl4id.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxerwv2alkcjfru7nl4id.png" alt=" " width="800" height="354"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkpt3op6p6m2zqr1gsydv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkpt3op6p6m2zqr1gsydv.png" alt=" " width="800" height="282"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F276ce3vynk03oea33unl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F276ce3vynk03oea33unl.png" alt=" " width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Upload Your Portfolio Files
&lt;/h2&gt;

&lt;p&gt;Now it's time to add your website content:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on your newly created bucket&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Upload&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Add your files by either:

&lt;ul&gt;
&lt;li&gt;Dragging and dropping your portfolio files directly, or&lt;/li&gt;
&lt;li&gt;Clicking &lt;strong&gt;Add files&lt;/strong&gt; to browse your computer&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Pro tip&lt;/strong&gt;: Make sure your main page is named &lt;code&gt;index.html&lt;/code&gt; — this is the file that loads when visitors arrive at your site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj7ai4vebru54p4c4bpxy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj7ai4vebru54p4c4bpxy.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Enable Static Website Hosting
&lt;/h2&gt;

&lt;p&gt;This is where the magic happens — let's transform your bucket into a web server:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to the &lt;strong&gt;Properties&lt;/strong&gt; tab of your bucket&lt;/li&gt;
&lt;li&gt;Scroll down to &lt;strong&gt;Static website hosting&lt;/strong&gt; and click &lt;strong&gt;Edit&lt;/strong&gt; (it's disabled by default)&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;Static website hosting&lt;/strong&gt; with these settings:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hosting type&lt;/strong&gt;: Static website hosting&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Index document&lt;/strong&gt;: &lt;code&gt;index.html&lt;/code&gt; (or your main HTML file name)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error document&lt;/strong&gt;: &lt;code&gt;error.html&lt;/code&gt; (optional but recommended for a custom 404 page)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvo3xoixdoyzcw45stpqp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvo3xoixdoyzcw45stpqp.png" alt=" " width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Save changes&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Take note of your &lt;strong&gt;Bucket website endpoint&lt;/strong&gt;, which will look something like:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;http://your-bucket-name.s3-website-us-east-1.amazonaws.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr13a7516xdtc7ib15m82.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr13a7516xdtc7ib15m82.png" alt=" " width="800" height="191"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your S3 bucket is now a simple web server! 🌐 However, it's not publicly accessible yet — let's fix that next.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 5: Configure Public Access Permissions
&lt;/h2&gt;

&lt;p&gt;Time to make your website accessible to the world:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the &lt;strong&gt;Permissions&lt;/strong&gt; tab&lt;/li&gt;
&lt;li&gt;Scroll to &lt;strong&gt;Block public access&lt;/strong&gt; and click &lt;strong&gt;Edit&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Uncheck all four boxes:

&lt;ul&gt;
&lt;li&gt;Block all public access&lt;/li&gt;
&lt;li&gt;Block public access granted through new ACLs&lt;/li&gt;
&lt;li&gt;Block public access granted through any ACLs&lt;/li&gt;
&lt;li&gt;Block public access granted through new bucket policies&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Acknowledge the warning by checking the confirmation box&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Save changes&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Don't worry about the warning&lt;/strong&gt; — this is completely normal for website hosting. You're intentionally making your site public so visitors can see it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhpfd2i0thw86qjkmsl1q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhpfd2i0thw86qjkmsl1q.png" alt=" " width="800" height="244"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 6: Apply Bucket Policy for Public Read Access
&lt;/h2&gt;

&lt;p&gt;Now we need to create a policy that explicitly allows anyone to view your website files:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the &lt;strong&gt;Permissions&lt;/strong&gt; tab, scroll to &lt;strong&gt;Bucket policy&lt;/strong&gt; and click &lt;strong&gt;Edit&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Paste the following policy, replacing &lt;code&gt;your-bucket-name&lt;/code&gt; with your actual bucket name:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Sid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"AllowPublicReadForWebsiteHosting"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Principal"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s3:GetObject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:s3:::your-bucket-name/*"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F885t47gct57x8rzm9xzw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F885t47gct57x8rzm9xzw.png" alt=" " width="800" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Save changes&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Policy Explanation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Effect&lt;/strong&gt;: Grants read access to your files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Principal&lt;/strong&gt;: Everyone (represented by &lt;code&gt;*&lt;/code&gt;) — meaning anyone on the internet&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Action&lt;/strong&gt;: Only read operations (&lt;code&gt;s3:GetObject&lt;/code&gt;) — visitors can view but not modify your files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource&lt;/strong&gt;: All files within the bucket (indicated by &lt;code&gt;/*&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This policy is secure because it only allows reading, not writing or deleting.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 7: Test Your Website
&lt;/h2&gt;

&lt;p&gt;The moment of truth — let's see your portfolio live:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Return to the &lt;strong&gt;Properties&lt;/strong&gt; tab&lt;/li&gt;
&lt;li&gt;Scroll to &lt;strong&gt;Static website hosting&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Bucket website endpoint&lt;/strong&gt; URL to view your live site&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0zc7xyixgf9f9guhuz5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0zc7xyixgf9f9guhuz5.png" alt=" " width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations! Your portfolio is now hosted on AWS S3. 🎉&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw080l62g5jo0xj0l6612.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw080l62g5jo0xj0l6612.png" alt=" " width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Error page looking like this&lt;/em&gt; ☠️ — &lt;em&gt;Don't forget to create a custom &lt;code&gt;error.html&lt;/code&gt; file to make even your 404 page look professional!&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Best Practices for S3 Hosting
&lt;/h2&gt;

&lt;p&gt;Follow these recommendations to maintain a professional, reliable portfolio:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Domain alignment&lt;/strong&gt;: If you plan to use a custom domain (like &lt;code&gt;www.yourname.com&lt;/code&gt;), name your bucket to match it for easier DNS setup&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DNS and CDN&lt;/strong&gt;: Use Route 53 for DNS management and CloudFront for HTTPS support and global content delivery — this adds security and speed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Version control&lt;/strong&gt;: Enable &lt;strong&gt;Versioning&lt;/strong&gt; in your bucket settings to protect against accidental file deletion or overwrites&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local backups&lt;/strong&gt;: Regularly back up your files to a local machine for extra safety&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficient updates&lt;/strong&gt;: Use the AWS CLI for quick syncing of file updates instead of manual uploads&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For more detailed information, check out the &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html" rel="noopener noreferrer"&gt;AWS Official Documentation on Website Hosting&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Optional Enhancements
&lt;/h2&gt;

&lt;p&gt;Ready to take your portfolio to the next level? Consider these upgrades:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Custom Domain &amp;amp; HTTPS&lt;/strong&gt;: Add a CloudFront distribution and request an SSL certificate from AWS Certificate Manager for secure, professional hosting with that coveted green padlock 🔒&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic Features&lt;/strong&gt;: Integrate AWS Lambda with SES for contact forms or backend processing capabilities — turn your static site into something more interactive&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analytics&lt;/strong&gt;: Track visitor behavior and site performance using CloudWatch dashboards to understand who's viewing your work&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI/CD Pipeline&lt;/strong&gt;: Set up GitHub Actions to automatically deploy changes whenever you push to your repository&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What You've Accomplished
&lt;/h2&gt;

&lt;p&gt;Your portfolio website is now live on one of the world's most reliable cloud platforms. You've learned:&lt;/p&gt;

&lt;p&gt;✅ How to create and configure an S3 bucket&lt;br&gt;&lt;br&gt;
✅ How to enable static website hosting&lt;br&gt;&lt;br&gt;
✅ How to manage public access and bucket policies&lt;br&gt;&lt;br&gt;
✅ Best practices for maintaining your site&lt;/p&gt;

&lt;p&gt;As your needs grow, you can easily scale this simple setup into a production-grade solution with enhanced security, performance, and functionality. This is just the beginning of your cloud journey!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's next?&lt;/strong&gt; Share your portfolio URL in the comments below — I'd love to see what you've built! 🚀&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Found this helpful? Don't forget to bookmark this guide for future reference and share it with fellow developers starting their cloud journey!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>awscommunity</category>
      <category>s3</category>
      <category>portfolio</category>
      <category>cloudcomputing</category>
    </item>
    <item>
      <title>Static Website Hosting with Amazon S3 and CloudFront</title>
      <dc:creator>Khaja Sabik Ahmed</dc:creator>
      <pubDate>Mon, 27 Jan 2025 04:27:20 +0000</pubDate>
      <link>https://dev.to/khajasabik/static-website-hosting-with-amazon-s3-and-cloudfront-2ljl</link>
      <guid>https://dev.to/khajasabik/static-website-hosting-with-amazon-s3-and-cloudfront-2ljl</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Discover how to build a high-performance web hosting architecture with Amazon Web Services (AWS). This guide explores the integration of Amazon EC2, CloudFront, and S3, offering a robust and scalable solution for hosting websites. By using EC2 as the foundation for your static website, CloudFront for global content delivery, and S3 for secure multimedia storage, you'll achieve lightning-fast performance and seamless user experiences.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnippjkqewgag4vd0ghfj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnippjkqewgag4vd0ghfj.png" alt="Image description" width="800" height="278"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Optimize your website for security, scalability, and cost-efficiency with AWS's powerful tools. Enhance global reach, improve content accessibility, and deliver a captivating digital experience that resonates with users worldwide. Unlock the potential of AWS and elevate your web hosting to the next level.&lt;br&gt;
Let's dive in and elevate your web presence to new heights.&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating an S3 Bucket:
&lt;/h2&gt;

&lt;p&gt;Objective: Create an S3 bucket with unique naming and configure it for hosting video content.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your AWS Management Console and navigate to the S3 service.&lt;/li&gt;
&lt;li&gt;Click on "Create bucket" and enter a unique name for your bucket.&lt;/li&gt;
&lt;li&gt;AWS Region in US East (N. Virginia) us-east-1.&lt;/li&gt;
&lt;li&gt;Checked the option for "Allow all public access" to restrict public access by default.&lt;/li&gt;
&lt;li&gt;Create your bucket. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7mdn6o1lm6cdugxjwt87.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7mdn6o1lm6cdugxjwt87.png" alt="Architectural Diagram" width="797" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upload your video content as S3 bucket objects.&lt;/li&gt;
&lt;li&gt;Open the bucket policy and configure specific permissions for website access only.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowMyWebsiteAccess",
            "Effect": "Deny",
            "Principal": "*",
            "Action": [
                "s3:GetObject",
                "s3:PutObjectAcl"
            ],
            "Resource": "arn:aws:s3:::your-bucket-name/*",
            "Condition": {
                "StringNotLike": {
                    "aws:Referer": [
                        "http://your-website-dns-name/",
                        "https://your-website-dns-name/"
                    ]}
            }
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Setting Up EC2 Instance:
&lt;/h2&gt;

&lt;p&gt;Objective: Host a static website on an EC2 instance and configure Apache server for content delivery.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your AWS Management Console.&lt;/li&gt;
&lt;li&gt;Navigate to the EC2 dashboard.&lt;/li&gt;
&lt;li&gt;Click on "Launch Instance" to start the instance creation wizard.&lt;/li&gt;
&lt;li&gt;Choose your desired Amazon Machine Image (AMI), instance type, configuration, and storage options.&lt;/li&gt;
&lt;li&gt;Configure security groups to allow SSH (port 22) and HTTP (port 80) access if necessary.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;
  
  
  Connect to the Instance:
&lt;/h4&gt;

&lt;p&gt;Retrieve the public IP address or DNS name of your EC2 instance from the EC2 dashboard. Use SSH (Secure Shell) to connect to the instance. Configure Apache to serve content from the &lt;code&gt;/var/www/html&lt;/code&gt; directory, which is the default document root.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -i your-key.pem ec2-user@your-instance-public-ip
sudo yum update
sudo yum install -y httpd
sudo systemctl enable httpd
sudo systemctl start httpd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fng5hptoxeeioeud7o0y5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fng5hptoxeeioeud7o0y5.png" alt=" Bucket Configuration" width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9qxuj0m3k4t0cklrq2z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9qxuj0m3k4t0cklrq2z.png" alt="Bucket Configuration" width="800" height="462"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Configure Apache to serve content from the &lt;code&gt;/var/www/html&lt;/code&gt; directory, which is the default document root. Then, replace the apache default html file by a static web hosting site where your content is shown.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
    &amp;lt;body style="text-align: center"&amp;gt;
        &amp;lt;h1 style="color: green"&amp;gt; AWS S3 Bucket&amp;lt;/h1&amp;gt;
             &amp;lt;p&amp;gt;Video on my Webpage&amp;lt;/p&amp;gt;
         &amp;lt;video width="500px" height="500px" controls="controls"&amp;gt;
        &amp;lt;source src="https://d2tt42f93n1936.cloudfront.net/Disney.mp4" /&amp;gt;
       &amp;lt;/video&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg2jebyo036mu61wblzcr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg2jebyo036mu61wblzcr.png" alt="Image description" width="453" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Modify Security Group Rules for EC2 Instance:
&lt;/h2&gt;

&lt;p&gt;To enhance security and restrict access to your EC2 instance only to requests originating from CloudFront, you can adjust the inbound and outbound rules of the instance's security group.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your AWS Management Console and navigate to the VPC dashboard.&lt;/li&gt;
&lt;li&gt;Click on "Prefix Lists" under the "Security" section.&lt;/li&gt;
&lt;li&gt;Identify the prefix list named &lt;a href="https://aws.amazon.com/blogs/networking-and-content-delivery/limit-access-to-your-origins-using-the-aws-managed-prefix-list-for-amazon-cloudfront/" rel="noopener noreferrer"&gt;amazonaws.global.cloudfront.origin-facing&lt;/a&gt;. This prefix list contains the IP ranges used by CloudFront to access your resources.&lt;/li&gt;
&lt;li&gt;Note the CIDR ranges listed within the prefix list.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg3amanhhvw8c5jxk0y2b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg3amanhhvw8c5jxk0y2b.png" alt="Image description" width="800" height="344"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Now, navigate to the EC2 dashboard and select your EC2 instance.&lt;/li&gt;
&lt;li&gt;Click on the security group associated with your EC2 instance to modify its rules.&lt;/li&gt;
&lt;li&gt;Adjust the inbound rules to allow traffic on ports 80 (HTTP) and 443 (HTTPS) only from the CIDR ranges specified in the amazonaws.global.cloudfront.origin-facing prefix list.
Example inbound rule:
Type: HTTP (80)
Source: Custom - Add the CIDR ranges from the CloudFront prefix list&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj0tf7588riv20fsaw8v3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj0tf7588riv20fsaw8v3.png" alt="Image description" width="800" height="363"&gt;&lt;/a&gt;&lt;br&gt;
By configuring the security group in this manner, you ensure that only requests originating from CloudFront's IP ranges are allowed access to your EC2 instance on ports 80 and 443. This helps to enhance the security posture of your infrastructure by restricting access to trusted sources.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring CloudFront Distribution:
&lt;/h2&gt;

&lt;p&gt;Objective: Distribute website content globally and enhance performance using CloudFront.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to the CloudFront service in the AWS Management Console.&lt;/li&gt;
&lt;li&gt;Create a CloudFront distribution for your EC2 instance.&lt;/li&gt;
&lt;li&gt;Paste your EC2 public DNS in Origin domain, Protocol- HTTP only.&lt;/li&gt;
&lt;li&gt;Next, Cache key and origin requests create a cache policy with any name as you wish and rest of the things remain as default. &lt;/li&gt;
&lt;li&gt;In Web Application Firewall (WAF), select Do not enable security protections, leave the others things to remain the same.&lt;/li&gt;
&lt;li&gt;Hit Create Distribution to obtain the CloudFront distribution URL for your website.
Wait couple of minutes to deploying all the thing in the distribution and after completing go to the 
Distribution domain name link.
If you go through the Public EC2 DNS-&lt;a href="http://ec2-18-234-1**-1**.compute-1.amazonaws.com/" rel="noopener noreferrer"&gt;http://ec2-18-234-1*&lt;em&gt;-1&lt;/em&gt;*.compute-1.amazonaws.com/&lt;/a&gt;  then you will get an error message “This site can’t reached”
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ewvrmb945d30hd37bbq.png" alt="Image description" width="800" height="412"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you use the CloudFront-&lt;a href="https://dev.tourl"&gt; https://d1ddraxwh8la3b.cloudfront.net&lt;/a&gt; link then only it will show you the website. This is the thing we have done in the security group. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhcncx901glph2a8wcvgs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhcncx901glph2a8wcvgs.png" alt="Image description" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbhraj3hse5669no6asbc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbhraj3hse5669no6asbc.png" alt="Image description" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Amazon Web Services (AWS) empowers you to build seamless, scalable, and secure web hosting architectures that captivate audiences worldwide. By leveraging Amazon EC2 for hosting, Amazon S3 for secure multimedia storage, and Amazon CloudFront for global content delivery, you can ensure fast, reliable, and engaging user experiences.&lt;/p&gt;

&lt;p&gt;With AWS’s advanced capabilities in security, scalability, and performance optimization, you're equipped to protect your infrastructure, enhance accessibility, and connect meaningfully with your audience. Whether it's delivering dynamic web pages, engaging videos, or a flawless cloud hosting solution, AWS provides the tools to make your web presence stand out.&lt;/p&gt;

&lt;p&gt;Embrace the full potential of AWS cloud hosting and take your digital footprint to the next level. The journey to innovation and excellence starts here—let your website shine and make a lasting global impact. Together, let's continue to innovate, excel, and build extraordinary web experiences.&lt;/p&gt;

</description>
      <category>cloudfront</category>
      <category>staticwebsitehosting</category>
      <category>awshostingsolutions</category>
      <category>cloudcomputing</category>
    </item>
  </channel>
</rss>
