Hosting my static website on AWS S3

I will be mainly following this AWS HOWTO guide. This post is not intended to be a full tutorial as there are plenty of great resources already, this is meant to remind me of the process and point to the existing guides.

Setting up an S3 bucket to host the website

Log in to your AWS account and set up a bucket. Because I will be using my own domain for the site I will also need to refer to this guide

I am using AWS Identity and Access Management (IAM) on my account so I need to setup a new user who only has access rights to this bucket. This guide should help. Beware the many older guides that don't include s3:putObjectAcl permission. The policy I applied to the user is:

  "Version": "2012-10-17",
  "Statement": [
      "Effect": "Allow",
      "Action": [
      "Resource": "arn:aws:s3:::*"
      "Effect": "Allow",
      "Action": ["s3:ListBucket"],
      "Resource": [""]
      "Effect": "Allow",
      "Action": [
      "Resource": ["*"]

Keep hold of the credentials for the newly created user, you will need them to configure s3cmd for the upload. You will also need to keep hold of the Static website hosting endpoint in my case.

Configure Pelican to upload site to S3 bucket

Pelican includes a build tartget in the makefile to upload to an S3 bucket. It uses s3cmd, which needs to be installed and configured:

workon pelican
pip install s3cmd
s3cmd --configure

If you didn't setup the bucket name when you configured pelican then you need to edit the Makefile and amend the S3_BUCKET variable. Once you have done this you can upload the website to S3:

make s3_upload

Transferring DNS to AWS Route 53

In order to serve the website from the root of your domain from S3 you must use AWS Route 53 as your DNS provider. I find Route 53 to be cheap, especially for low volume websites. I followed this guide to setup the hosted zone. The name servers that will host my DNS records from Route 53 are as follows:

My domain is currently held with LCN, so I logged into their management console to gather the details I needed to transfer to Route 53. Key entries include:

A Record:

CNAME Records:
MX Records:, priority 10, priority 20, priority 20, priority 30, priority 30
TXT Records:
    v=spf1 ~all

Once these entries were configured in Route 53 I can change the Nameservers entry against the domain in the LCN settings to point to the Route 53 Name servers we identified above when setting up the hosted zone.

As you are now reading this on it must have been successful :-)

Go Top