Host a Basic HTML Website on AWS & GitHub

1. Hosting on AWS S3

  1. Create an S3 Bucket: Go to AWS S3 and create a bucket. Make sure the bucket name is globally unique.
  2. Enable Static Website Hosting: In the bucket properties, enable "Static website hosting" and set index.html as the index document.
  3. Upload Your HTML File: Upload your HTML file (like this page) to the bucket.
  4. Set Permissions: Add a bucket policy to allow public read access:
    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "PublicReadGetObject",
                "Effect": "Allow",
                "Principal": "*",
                "Action": "s3:GetObject",
                "Resource": "arn:aws:s3:::your-bucket-name/*"
            }
        ]
    }
  5. Access Your Website: Use the endpoint in the S3 bucket static website hosting settings.

Optional: Use Route 53 to connect a custom domain.

2. Hosting on GitHub Pages

  1. Create a GitHub Repository: Go to GitHub and create a new repository. Initialize it with a README if you like.
  2. Add Your HTML File: Upload your index.html file to the repository.
  3. Enable GitHub Pages:
    • Go to Settings → Pages.
    • Select the branch (usually main) and root folder as the source.
    • Click Save. GitHub will provide a public URL for your website.
  4. Visit Your Website: Use the provided URL to see your live site.
  5. Optional Custom Domain: You can add a custom domain in the GitHub Pages settings using a CNAME record.