Search⌘ K
AI Features

Enable Static Web Hosting

Explore how to enable static website hosting on AWS S3 using CLI commands. Understand the difference between high-level and low-level commands like aws s3 website and aws s3api put-bucket-website, and configure your S3 bucket to serve static content using index documents and JSON configuration.

Before we host our static website using S3, it’s important to note that AWS S3 only supports static web hosting. We can’t host server-side code, which means dynamic hosting isn’t supported in S3.

Enable static web hosting using the AWS CLI

Use the high-level website subcommand:

To enable static web hosting using the AWS CLI, the website subcommand can be used.

Syntax:

aws s3 website <target> [--options]

Example:

 ...