X
Popular Searches

How to Set Up a Website with a CDN on AWS Lightsail

AWS Logo

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.

select instance template

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

add SSH keys , turn on Automatic Snapshots.

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

LightSail tiers.

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.

Networking tab > 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.

Choose origin.

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.

Different preset options for cache behavior.

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.

Distribution pricing.

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.

Anthony Heddings Anthony Heddings
Anthony Heddings is the resident cloud engineer for LifeSavvy Media, a technical writer, programmer, and an expert at Amazon's AWS platform. He's written hundreds of articles for How-To Geek and CloudSavvy IT that have been read millions of times. Read Full Bio »

The above article may contain affiliate links, which help support CloudSavvy IT.