# Set index.html as default file on S3 bucket

- Published: 2016-07-13
- URL: https://notes.webutvikling.org/set-index-html-as-default-file-on-s3-bucket
- Tags: aws, bucket, s3, website

```
aws s3 website $MY_BUCKET_NAME --index-document index.html
```

Note: Your index.html will **not** be rendered when the short s3-path is requested (e.g. bucket.s3.amazonaws.com), only when the full dns is used (e.g.bucket.s3-website.eu-central-1.amazonaws.com/)

If that doesn't work, make sure you've fulfilled the prerequisites below.

```bash
# prerequisite: Install aws-cli
pip install awscli

# prequisite: set up AWS-keys
export AWS_ACCESS_KEY_ID=[MY_ACCESS_KEY]
export AWS_SECRET_ACCESS_KEY=[MY_SECRET_KEY]
```
