Setup and install a CDN using Caddy on Ubuntu 24.04 in Azure, AWS or Google GCP. Self-hosted content delivery network CDN using Caddy. Caddy CDN offers fast, secure, and reliable delivery of static and dynamic web assets. With its caching, SSL, and reverse proxy capabilities, Caddy CDN optimizes web performance and scales content delivery without complex setups. Deploy using our Caddy image from any of the cloud marketplaces, links below:
Self-Hosted Cloud Caddy CDN
Azure Caddy CDN
Deploy Caddy CDN on Ubuntu 24.04 in Azure
AWS Caddy CDN
Coming soon..
GCP Caddy CDN
Coming soon..
Getting Started with Caddy CDN
Once your Caddy server has been deployed, the following links explain how to connect to a Linux VM:
Once connected and logged in, the following section explains how to start using Caddy as a Content Delivery Network (CDN).
Check Caddy Status and Version
To confirm Caddy is running and the version, run the following commands:
sudo systemctl status caddy
caddy version
Setup Caddy as Content Delivery Network (CDN)
Here’s a step-by-step guide to setting up Caddy as a basic Content Delivery Network (CDN). This setup will use Caddy’s reverse proxy and caching capabilities to distribute content efficiently across multiple locations.
This setup will cache static content for 30 days, improving load times for repeat visitors. The X-Cache-Status header lets you see cache hits and misses.
Once you’ve saved changes and exited the caddy file, reload Caddy to apply changes:
sudo systemctl reload caddy
Testing Caching in Caddy
Use curl to send multiple requests to a cached endpoint, inspecting the response headers to see if caching is working:
curl -I http://yourdomain.com
Look for the X-Cache-Status header in the response. A response of HIT indicates that the cache is working, while MISS suggests that content is not yet cached.
Step 2. Enable Reverse Proxy to Origin Server
Set up Caddy as a reverse proxy to your main origin server. In your Caddyfile, configure it to point requests to the origin:
Disclaimer: Caddy® is a registered trademark of Light Code Labs, LLC and is licensed under Apache License 2.0 license. The license comes with a “no warranty” clause, meaning the software is provided “as-is” without any guarantees or liability for issues that may arise.
Cloud Solution Architect. Helping customers transform their business to the cloud. 20 years experience working in complex infrastructure environments and a Microsoft Certified Solutions Expert on everything Cloud.