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.
-
Navigate to the Amazon S3 console and select the bucket you created for static hosting.
-
Choose Upload → Add files (and Add folder, if needed).
-
Select the website files from your local project.
-
Choose Upload to begin the transfer.
Tip
You can upload the entire website root folder, or upload files and folders individually.
Recommended Folder Structure
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.htmlmust be located at the root level for CloudFront to load the site automatically.error.htmlimproves 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.htmlexists at the bucket root.- All folders and asset files uploaded successfully.
- No nested folder issues occurred (for example,
/website/website/index.html).