AWS Lightsail is a great platform for building web applications. It’s easy to use, and the features are plentiful. One of the great things about AWS Lightsail is that you can use a CDN to speed up your web application loading time. To set up a website on AWS Lightsail with a CDN, you first need to create an account and set up your environment. Then, you can create a new AWS account and add the lightsail-cdn key to your Amazon Web Services account. Once you have added the key, you can create an Amazon S3 bucket and put your files in it. You then need to set up an IAM role for your bucket and add the lightsail-cdn IAM role to it. Finally, you need to set up an A2B connection between your bucket and the CDN. Once everything is setup correctly, you can start using the CDN to speed up your web application loading time!


AWS Lightsail is a simpler subset of AWS intended for IT beginners. This week, AWS announced support for CloudFront CDNs in Lightsail, with fixed monthly pricing starting at $2.50. We’ll walk through setting up a high-performance website on Lightsail.

A Content Delivery Network (CDN) speeds up your website by caching it closer to users around the world. It ensures that even if you only have a server in one location, users in other regions can still access it quickly. It also takes some stress off your primary web server, because users will be hitting cache instead of requesting it from your origin every time.

Setting Up a Lightsail Website

Head over to the Lightsail Management Console and create a new instance. There are a few “Blueprints” you can choose from, which are preset images that come with software preinstalled, like WordPress or NGINX.

You’ll probably want to add your SSH keys here, and turn on Automatic Snapshots that will create incremental backups every day.

Lightsail has a few tiers for compute instances to choose from, which you can sort by memory, CPU, storage, or bandwidth.

Lightsail will take a few minutes to set up your instance and install any software on it.

Enabling CloudFront CDN

From the Networking tab, click “Create Distribution.

The origin of your CDN will be the web server instance. Select this from the dropdown, but if you don’t have a static IP address assigned, you’ll have to create one here.

The CDN has a few different preset options for cache behavior. If you’re using WordPress, Lightsail will default to “best for WordPress.” Otherwise, you can set it to “Best for static sites” or configure it yourself.

Pricing for the CDN is determined by how much bandwidth you’ll be expecting. The lowest tier, 50 GB, is $2.50 per month. Data for AWS goes at about $0.09 per GB, so these tiers are actually very cheap compared to regular AWS prices.

The CDN will take a few minutes to set up, but once it’s done it should be available from the URL given to you in the console. You’ll need to configure your DNS to point to this endpoint.