---
title: "How to set up a CDN"
description: "A step-by-step guide to setting up a CDN: create a deployment, configure your origin, point DNS with a CNAME, set caching rules, and go live with free SSL."
url: "https://edge.network/academy/how-to-set-up-a-cdn"
category: "Best practices"
readingTime: "3 min"
level: "beginner"
---

# How to set up a CDN

Putting a CDN in front of your site takes about five minutes: create a deployment, point it at your origin, and update one DNS record. Here's the full walkthrough.

![Configuration options when creating a deployment](/media/docs/control-cdn-create.svg)

## Before you start

A CDN sits between your users and your origin server, caching content at edge locations so most requests never touch your infrastructure. To set one up you need three things: an account with a CDN provider, a domain or subdomain you want to serve through the CDN (with access to its DNS settings), and an origin: the place your content actually lives, whether that's a web server, an S3-compatible bucket, or any URL that serves your files.

The steps below use [Edge CDN](/cdn), where the free tier covers 3 deployments and 500,000 requests a month, but the process is broadly the same on any provider. The [getting started documentation](/docs/cdn/getting-started) covers the same flow with screenshots.

## 1. Create an account and a deployment

[Sign up for an account](/console), then navigate to **CDN** in the sidebar and click **Deploy CDN**. A deployment is a container for your CDN domains. You might have one per project or per environment. Give it a name (for example "Production") and click **Create Deployment**.

## 2. Add your domain and origin

Click **Add Domain** and enter the domain you want to serve through the CDN (say `cdn.yoursite.com`) along with your origin URL, such as `https://origin.yoursite.com` or an S3 bucket URL. The origin is where the CDN fetches content it doesn't yet have cached.

If you're hosting a static site, you can use an [Edge Storage](/storage) bucket as the origin type instead: upload your files, and the CDN serves them directly (including `index.html` for directory paths) with no web server to run at all.

## 3. Point your DNS at the CDN

At your DNS provider, add a CNAME record for your subdomain pointing to `cdn.edge.network`. For `cdn.yoursite.com`, that means a CNAME with name `cdn` and target `cdn.edge.network`. For a root domain, use your DNS provider's CNAME flattening or ALIAS record support.

Propagation usually takes one to five minutes. Then click **Check DNS** in the console to verify the record. If you manage your zone on [Edge DNS](/dns), changes propagate globally in under five seconds.

## 4. Wait for SSL, then go live

Once DNS is verified, a free SSL certificate is issued automatically via Let's Encrypt, typically within 30 to 60 seconds. When the status shows **SSL: active**, your domain is being served through the CDN over HTTPS. There are no certificate files to manage, and renewal is automatic.

## 5. Configure caching rules

Out of the box the CDN caches sensibly, but path-based cache rules let you tune behaviour per content type: long TTLs (7–30 days) for static assets like `/assets/*`, `*.js`, and `*.css`; long TTLs with image optimisation enabled for `/images/*`; and short TTLs or a bypass for `/api/*` and personalised pages. Our [caching strategies](/academy/caching-strategies) guide covers the reasoning in depth.

## 6. Test, and purge when you need to

Verify everything is working with a quick header check:

```bash
curl -I https://cdn.yoursite.com/path/to/file.jpg
```

Look for `x-cache: HIT`, which confirms the response came from cache. When you deploy new content, use instant cache purging from the console to invalidate stale files; on Edge, purges take effect in under a second.

## What a CDN gives you from day one

Once traffic flows through the CDN, these benefits apply immediately.

- **Faster loads everywhere:** content is served from the node nearest each user rather than from a single origin, cutting latency worldwide.
- **Less origin load:** cached requests never reach your server, so you can run smaller infrastructure and survive traffic spikes.
- **Built-in protection:** DDoS mitigation and automatic SSL are included. Attack traffic is absorbed at the edge before it reaches you.
- **Real-time analytics:** traffic, cache hit rates, and geographic distribution are visible from the console as they happen.

## Set up your CDN now

Free for 3 deployments and 500k requests a month, with automatic SSL and zero egress fees.

## Next steps

- [Create a deployment](/console)
- [Read the docs](/docs/cdn/getting-started)
