How to Set Up a Free CDN for WordPress on a Budget VPS

A cheap VPS gives you full control of your WordPress site, and it also gives you a problem: every image, stylesheet, and script travels from one server to every visitor, no matter where they live. A free CDN for WordPress fixes the distance part. It copies your static files to servers around the world and serves each visitor from the nearest one, so your small VPS handles fewer requests and your pages load faster. This guide covers the whole setup on a budget VPS, from picking a provider to checking that the CDN is actually serving your files.

Expect 30 to 60 minutes, most of it waiting for DNS to spread. You need access to your domain registrar, your VPS, and WordPress admin. Nothing here costs money, and you do not need to move your site or change hosts.

What a CDN Does for a WordPress Site on a Small VPS

A content delivery network is a set of servers spread across many locations. When a visitor opens your site, the CDN serves static files such as images, CSS, and JavaScript from the server closest to them. Your VPS still generates the HTML for each page, but it no longer sends every file to every visitor. On a 1 GB or 2 GB VPS, that matters: fewer connections mean less RAM pressure on PHP and the web server, and visitors abroad stop waiting on one slow route back to your server.

A CDN also absorbs some of the junk traffic that hits every WordPress site. Bots that request the same image hundreds of times get answered by the CDN edge instead of your VPS. That does not replace a firewall or a login limiter, but it cuts pointless load. The catch: a CDN only helps with static content. Slow database queries, a heavy theme, and uncached pages still run on your VPS. It takes the delivery trucks off your driveway; it does not rebuild the house.

Picking a Free CDN That Fits a Budget VPS

For a small WordPress site on a budget VPS, the Cloudflare free plan is the practical default. It has no bandwidth cap on the free tier, it includes a shared SSL certificate, and it works by changing your domain nameservers, which means no plugin is required to start. Our walkthrough on setting up Cloudflare in front of a VPS covers the Cloudflare side in detail; this guide focuses on the WordPress side.

Two other names come up often, and both are worth understanding before you pick. Bunny CDN and KeyCDN charge by usage and cost very little for a small site, but neither offers a permanent free tier, so they are low-cost rather than free. If your traffic grows past what the free tier handles well, our comparison of Cloudflare Pro versus the free plan lays out when paying starts to make sense. Prices change, so check official pricing before you commit to any paid plan.

Option Cost for a small site Setup effort Best for
Cloudflare free plan Free Nameserver change Most small WordPress sites on a VPS
Bunny CDN Pay per use, low Plugin or pull zone setup Sites that want a pure CDN without proxy features
KeyCDN Pay per use, low Plugin or pull zone setup Sites with steady traffic that outgrow free tiers

The rest of this guide uses Cloudflare: it is free, needs no WordPress plugin, and covers most small sites. The ideas transfer to other CDNs, but the screens will differ.

Setting Up a Free CDN for WordPress: Step by Step

Create a free Cloudflare account and add your site. Cloudflare scans your current DNS records and shows a list. Check it carefully: your root domain, the www subdomain, and any subdomains such as staging or mail must all be there with the right IP addresses. A missing mail record is the most common mistake here, and it can break email delivery, so compare each record against your registrar or VPS panel first.

Next, Cloudflare gives you two nameservers. Replace the nameservers at your registrar with those two, and leave everything else alone. DNS changes can take a few minutes or a few hours to spread. You can watch progress with a DNS checker or by running dig NS yourdomain.com from your VPS terminal. While you wait, leave WordPress alone. Our guide to pointing a domain at your VPS and setting up free HTTPS covers the same DNS steps, and its HTTPS steps pair well with what follows.

Once Cloudflare shows your site as active, set the SSL mode to Full if your VPS already has a valid certificate, or Full (Strict) if you want Cloudflare to check that certificate on every request. Flexible mode works without a certificate on your VPS, but it leaves the Cloudflare-to-server connection unencrypted. If your VPS has no certificate yet, install one with Certbot first, then pick Full.

Connect WordPress to the CDN

With DNS pointed at Cloudflare, your static files already flow through the CDN with no plugin installed. A wordpress caching plugin still helps, because it controls which pages get cached and for how long. The official Cloudflare plugin for WordPress is a solid choice: it applies recommended settings, purges the cache when you update a post, and adds the real visitor IP to your logs. Install it, connect it with an API token from your Cloudflare dashboard, and turn on automatic cache purging.

Then set up cache rules in the Cloudflare dashboard. A useful starting point is one rule that caches everything under /wp-content/uploads/ for a month, since uploaded images rarely change. Add another rule that bypasses the cache for /wp-admin/ and preview URLs, so you never see a stale admin screen or cached draft. Exclude the login page, plus cart and checkout if you run WooCommerce. These rules take five minutes and stop the most common CDN headache: cached pages showing old content to logged-in users.

Before you switch anything on the live site, test the setup on a copy. If you keep a staging copy of your site, run the nameserver change there first and click through the admin area, the login page, and a few posts. Our guide to setting up a staging copy of WordPress on the same VPS shows how to build one without a second server. Catching a broken cache rule on staging costs minutes. Catching it on the live site costs visitors.

What a Free CDN Does Not Fix

A CDN for WordPress VPS hosting helps with delivery, not with generation. If your pages take three seconds to build because of slow queries or a heavy page builder, the CDN still waits three seconds for the HTML. Fix the slow parts first: a caching plugin that serves full pages, an object cache such as Redis if your VPS has the RAM, and a theme that does not load half a dozen font files and sliders on every page.

The free tier has limits. Cloudflare free plan users get shared SSL and basic firewall rules, but no image optimization beyond the basics. Large video files do not belong on a CDN built for web pages. Host video on a platform made for it and embed it. And a CDN is not a backup. Your site files and database still live on one VPS, so keep your regular backups running. A CDN makes your site faster and tougher, not indestructible.

Check That the CDN Is Working

After setup, verify the result instead of assuming it. Open your site in a private browser window and check the response headers for a static file, such as an image from your uploads folder. With curl from your terminal, run curl -I https://yourdomain.com/wp-content/uploads/2026/12/example.jpg and look for a cf-cache-status header. HIT means the CDN served the file. MISS on the first request is normal. Reload and check again; if you keep seeing MISS or DYNAMIC, your cache rule is not matching that path.

Then measure the difference. Run a speed test from a location far from your VPS before and after the change, and compare time to first byte and fully loaded time. Run each test three times and take the middle result. You should see the biggest gains on image-heavy pages and for visitors far from your server. If nothing changes, check that your DNS actually points at Cloudflare and that your cache rules do not exclude the paths you tested.

Keep It Running With Almost No Effort

A free CDN for WordPress needs little upkeep once it works. Purge the cache after a theme change or a site-wide image update, and check the Cloudflare analytics page once a month to see how much traffic the CDN absorbs. If traffic grows a lot, revisit the paid plan comparison and decide from your real numbers.

Set it up once, test it properly, and leave it alone. Your VPS will run cooler, your visitors will wait less, and you will have spent nothing to get there.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.