Skip to content

Upload Website Files

After creating the S3 bucket, the next step is to upload the website assets (HTML, CSS, JavaScript, images, documents, etc.). These files will later be served securely through CloudFront.


  1. Navigate to the Amazon S3 console and select the bucket you created for static hosting.

  2. Choose Upload → Add files (and Add folder, if needed).

  3. Select the website files from your local project.

  4. Choose Upload to begin the transfer.

    Tip

    You can upload the entire website root folder, or upload files and folders individually.

The following structure supports predictable file paths and efficient caching when served through CloudFront:

/
├─ index.html
├─ error.html
├─ assets/
│   ├─ css/
│   ├─ js/
│   ├─ images/
└─ docs/

Important considerations

  • index.html must be located at the root level for CloudFront to load the site automatically.
  • error.html improves the user experience for 403/404 error responses.
  • Storing assets (CSS, JS, images) in subfolders helps with cache control and versioning.

Confirm storage class and permissions

For each uploaded object, verify that the defaults remain unchanged:

Setting Status
Storage class Standard
Encryption SSE-S3 or SSE-KMS
Object ownership Bucket owner enforced
Public access Blocked (do not modify)

Warning

Do not make objects public. CloudFront will provide secure public access, not the S3 object URL.

Validate a successful upload

Verify the following before proceeding:

  • index.html exists at the bucket root.
  • All folders and asset files uploaded successfully.
  • No nested folder issues occurred (for example, /website/website/index.html).