You can put a live site behind Cloudflare in 20 to 40 minutes without moving hosts. Add the domain, replace the nameservers at your registrar, then tune three layers: DNS and the proxy, cache, and TLS with the security rules. The Free plan is enough for a blog or a brochure site: it includes the CDN, a Universal SSL certificate and unmetered DDoS protection. Prices and limits below were checked in November 2026 against the official pricing pages.

Cloudflare does not make a slow server fast, and it does not fix a poorly indexed database. It puts a reverse proxy and an authoritative DNS server in front of your origin, caches static files and filters some traffic before it reaches your machine. The gain comes from distance, cache and security rules; no single toggle produces it.

What Cloudflare does and does not do#

Your host keeps the site, the database and the files. Cloudflare answers DNS queries and receives HTTP or HTTPS traffic instead of your server. Visitors resolve the domain to Cloudflare anycast addresses, not to your machine's IP. The proxy then forwards the request to the origin, or serves a copy from the nearest data center.

Three practical consequences follow. Your origin IP becomes harder to target, provided you do not leak it through a DNS-only subdomain. Static files can be served without touching your server. WAF rules, rate limiting and Under Attack mode run before the origin.

What Cloudflare does not do: it does not replace a host, it does not back up your database, and it does not cache personalized pages by default. An account page, a cart or an API response that depends on a cookie must not be served to another visitor. Cloudflare describes the Free plan as being for personal or hobby projects that are not business-critical. For a client site, Pro at $20 per month billed annually, or $25 month to month, is the reference.

Step 1: prepare DNS before changing nameservers#

Export the current zone before you change anything. Write down the A, AAAA and CNAME records that serve the web, but also the MX records, the TXT records used for email authentication, service verification records and any forgotten subdomains. A common miss is an internal tool or a marketing campaign on a subdomain that nobody remembers until it breaks three days later.

bash
dig +short example.com A
dig +short example.com AAAA
dig +short example.com MX
dig +short example.com TXT
dig +short example.com NS

Lower the TTL on your records to 300 seconds 24 to 48 hours before the switch. If you need to roll back, resolvers forget the old value faster. It is optional, but it is the difference between a ten-minute migration and an evening spent waiting for propagation.

If the domain uses DNSSEC, disable it at the registrar before changing nameservers. The DNSSEC documentation explains why: records signed by the old provider do not match the new ones, and validating resolvers return SERVFAIL. You can re-enable DNSSEC inside Cloudflare once the domain is active, then add the DS record at the registrar.

Keep a copy of your mail records too. Cloudflare can host DNS without touching email, as long as the MX and TXT records stay DNS only.

Step 2: add the domain and switch nameservers#

In the Cloudflare dashboard, choose Onboard a domain, enter the apex domain, and let Cloudflare scan the zone. The scan does not always find everything: compare the proposed list with your notes and add the missing records. Pick the Free plan to start, then continue.

Cloudflare assigns two authoritative nameservers, for example ada.ns.cloudflare.com and bob.ns.cloudflare.com. Copy them to your registrar in place of the old ones. Verification can take up to 24 hours, although it is often faster. During that window the domain is pending and some protections are not active yet.

bash
dig +short example.com NS
dig +short example.com A

Once the domain is active, check the proxy status of every web record. An A, AAAA or CNAME record set to Proxied shows an orange cloud: traffic goes through Cloudflare. DNS only shows a gray cloud: Cloudflare returns the real origin address and caches nothing. MX and TXT records are always DNS only, and a domain-verification CNAME should not be proxied.

One detail surprises people: a proxied record has an Auto TTL fixed at 300 seconds, and you cannot edit it. That lets Cloudflare change its anycast addresses without a long wait. Another rule: if a name has several A or AAAA records and at least one is proxied, Cloudflare treats every record on that name as proxied.

If you need a new domain, Cloudflare Registrar sells at cost, starting at $7.85 according to the pricing page. You do not need it to use Cloudflare, and a domain bought elsewhere works fine.

Step 3: set up TLS before turning on cache#

Cloudflare issues a free Universal SSL certificate for every active domain. It covers the root domain and first-level subdomains, such as example.com and www.example.com. For a deeper subdomain, you need Total TLS or an advanced certificate.

The setting that matters is the encryption mode between Cloudflare and your origin. Choose Full (strict) when your server presents a valid certificate from Let's Encrypt or Cloudflare Origin CA. This mode validates the origin certificate and blocks an unencrypted or impersonated connection. Flexible encrypts visitor-to-Cloudflare traffic but not Cloudflare-to-origin traffic: avoid it, and above all do not combine Flexible with an HTTP-to-HTTPS redirect on the origin, which creates a redirect loop.

Then enable Always Use HTTPS to redirect all HTTP traffic to HTTPS. Wait until the site works correctly before enabling HSTS. Once HSTS is on, a browser refuses HTTP for the duration of max-age; if you turn off HTTPS or move a record to DNS only, visitors can lose access. Start with a short duration, test, then lengthen it. Only tick Preload when every subdomain is ready: the preload list requires a max-age of at least 12 months.

bash
curl -I http://example.com
curl -I https://example.com
openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -issuer -dates

The last command prints the issuer and dates of the certificate seen by the client. If the issuer is Cloudflare and the dates are valid, the visitor-facing chain is in place. The origin certificate is checked on the server or with a direct call to the origin address.

Step 4: understand what Cloudflare caches#

The default cache follows precise rules. Cloudflare caches by file extension, not by MIME type. The CDN does not cache HTML or JSON by default, but it does cache robots.txt. Images, CSS, JavaScript, fonts, PDFs and video files are among the supported extensions.

Cloudflare respects origin headers. It does not cache a response when Cache-Control is private, no-store, no-cache or max-age=0, when the response contains a Set-Cookie header, or when the method is not GET. It does cache when Cache-Control: public has a max-age greater than zero, or when Expires is in the future. Without a header, 200, 206 and 301 responses get a default TTL of 120 minutes, 302 and 303 get 20 minutes, and 404 and 410 get 3 minutes.

Size matters too. Cacheable files are capped at 512 MB on Free, Pro and Business. The maximum upload size is 100 MB on Free and Pro, 200 MB on Business. Beyond that, the request can fail before it ever reaches the cache.

Set headers at the origin rather than forcing everything in the dashboard. With NGINX, one simple rule separates versioned assets from pages:

nginx
location ~* \.(?:css|js|jpg|jpeg|png|webp|avif|svg|woff2)$ {
  add_header Cache-Control "public, max-age=31536000, immutable";
}

location = /index.html {
  add_header Cache-Control "no-cache";
}

A file whose name contains a hash can be cached for a year. An HTML page that changes should stay no-cache or use a very short TTL. On WordPress, exclude /wp-admin, /wp-login.php, the cart and checkout. On Next.js, files under /_next/static are already immutable and suit a long cache.

Cache Rules go further. Cloudflare allows 10 on Free, 25 on Pro, 50 on Business and 300 on Enterprise. You can, for example, cache everything under /assets/ for a year, then bypass the cache for /api/ and /admin/. In the dashboard, open Rules > Cache Rules, create a rule with the expression builder, then choose Eligible for cache and an Edge TTL. Always test with a real file: a rule that does not match breaks nothing, but does nothing either.

Cache purge is immediate at Cloudflare, not in the visitor's browser. The Free plan accepts 800 URLs per second for single-file purge, and 5 requests per minute for purge by hostname, tag, prefix or everything, with a bucket of 25 and 100 operations per request. The API is the practical way to automate a deployment:

bash
curl -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/purge_cache" \
  -H "Authorization: Bearer $CF_API_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"files":["https://example.com/assets/app.css"]}'

Check the result with the CF-Cache-Status header. HIT means Cloudflare served its copy; MISS means it fetched from the origin.

bash
curl -sI https://example.com/assets/app.css | grep -iE 'cf-cache-status|cache-control|server'

Step 5: turn on the protections that matter#

DDoS protection is included and unmetered on every plan. That is the first reason a small site uses Cloudflare: a volumetric attack is absorbed before it reaches your server.

The WAF depends on the plan. Free includes the Free Managed Ruleset, which covers widely exploited vulnerabilities. Pro adds the Cloudflare Managed Ruleset and the OWASP Core Ruleset, with more rules and the ability to tune them. On Free, the inspected request body is capped at 1 MB; beyond that, part of the request is not analyzed.

Rate limiting is useful on login forms and APIs. Free allows one rule, with a 10-second period and a 10-second mitigation, counted per IP address. Pro raises that to two rules, with a period up to one minute and a mitigation up to one hour. A typical rule: more than 20 requests to /login in 10 seconds from the same IP, then a 10-second block. Test with a browser and a script before blocking broadly.

Bot Fight Mode is free and challenges clients that look like bots. It can also challenge an API or a mobile app, and it cannot be bypassed with a WAF rule. Enable it on a brochure site, not on an API without testing. Under Attack Mode adds a managed challenge to every request; use it during an attack, not permanently, because it also gets in the way of legitimate visitors and some API calls.

To hide the origin address completely, Cloudflare Tunnel works without opening an inbound port. The cloudflared daemon opens an outbound connection to Cloudflare, and public traffic arrives through that tunnel. If you keep an exposed origin, at least restrict its firewall to Cloudflare's published address ranges, and check that no subdomain answers in DNS only with the real address.

bash
cloudflared tunnel login
cloudflared tunnel create blog
cloudflared tunnel route dns blog blog.example.com
cloudflared tunnel run blog

Verify that everything works#

Run a five-minute check. The domain should resolve to Cloudflare, the certificate should be valid, an asset should show HIT, a logged-in page should not show HIT, and a missing page should return a proper 404.

bash
dig +short example.com NS
curl -sI https://example.com | grep -iE 'server|cf-ray|strict-transport-security'
curl -s -o /dev/null -w "%{http_code} %{time_total}\n" https://example.com
curl -sI https://example.com/assets/app.css | grep -i cf-cache-status

Test from another network or through a VPN as well. A cache filled on your own connection can hide an origin problem. If you see a Set-Cookie header on a cached static asset, fix the origin: that cookie can prevent caching or, worse, be served to several visitors.

What it costs in November 2026#

Cloudflare bills in US dollars. The prices below are public and exclude taxes.

PlanPriceWhat changes
Free$0CDN, DNS, Universal SSL, unmetered DDoS protection, Free Managed Ruleset, 10 cache rules, 1 rate limiting rule
Pro$20/mo billed annually, $25/mo monthlyCloudflare Managed Ruleset, OWASP Core Ruleset, 25 cache rules, 2 rate limiting rules, ticket support
Business$200/mo billed annually, $250/mo monthly100% uptime SLA, chat support, 50 cache rules, 5 rate limiting rules, PCI DSS 4.0 compliance
ContractCustomCustom features and commitment

A few add-ons: Argo Smart Routing from $5 per month, Load Balancing from $5 per month, Automatic Platform Optimization for WordPress at $5 per month on Free, Advanced Certificate Manager at $10 per month, Cache Reserve usage-based. Cloudflare Registrar starts at $7.85 for a domain, at cost.

For a blog, the Free plan is enough. Move to Pro when you want the managed WAF rules, more cache and rate limiting rules, or ticket support. Business makes sense for a store that needs an SLA, chat support and PCI compliance. A high-traffic site can also look at Cache Reserve and Argo, but the bill becomes variable.

Mistakes that cost an evening#

  • DNSSEC still active at the registrar. The nameservers change, but resolvers return SERVFAIL. Disable DNSSEC before the switch, then re-enable it inside Cloudflare.
  • Flexible mode with an HTTPS redirect on the origin. Cloudflare talks HTTP to the origin, the origin redirects to HTTPS, Cloudflare passes the redirect back: a loop. Switch to Full (strict).
  • Caching a personalized page. An account page or cart served from cache shows another visitor's data. Keep HTML out of cache or bypass session cookies.
  • HSTS preload too early. A subdomain without HTTPS becomes unreachable. Wait until every subdomain is ready before ticking Preload.
  • Exposed origin address. A DNS-only subdomain, a forgotten AAAA record or direct IP access bypasses Cloudflare. Restrict the origin firewall to Cloudflare ranges or use Tunnel.
  • Confusing edge purge with browser cache. Purging the edge does not clear the visitor's browser. Version file names or lower the page max-age.
  • Bot Fight Mode on an API. Legitimate calls get challenged. Test it, or leave it off on machine-facing routes.

Frequently asked questions#

Frequently asked questions

Is Cloudflare free for a blog?

Yes. The Free plan at $0 includes the CDN, DNS, Universal SSL, unmetered DDoS protection and the Free Managed Ruleset. Cloudflare positions it for personal or hobby projects that are not business-critical. For a client site, budget Pro at $20 per month billed annually, or $25 monthly.

Do I need to change hosts to use Cloudflare?

No. Cloudflare sits in front of your existing host. You keep the site, database and files where they are. You only need to change nameservers at the registrar and, for Full (strict), present a valid certificate on the origin.

Does Cloudflare cache HTML pages?

Not by default. The CDN caches by extension and does not take HTML or JSON without an explicit rule. That is deliberate: a cached personalized page can show another user's data. Use a targeted Cache Rule for public pages and keep account pages out of cache.

Flexible or Full (strict)?

Full (strict) in almost every case. It also encrypts the Cloudflare-to-origin connection and validates the origin certificate. Flexible only encrypts the visitor-to-Cloudflare leg and causes loops with an HTTPS redirect at the origin. It is only useful for an origin that cannot provide TLS.

Does Cloudflare protect against DDoS attacks?

Yes. DDoS protection is included and unmetered on every plan. It absorbs volumetric traffic before the origin. Finer application attacks are handled with the WAF, rate limiting and, during an attack, Under Attack mode.

How do I roll back?

Put the old nameservers back at the registrar. If you lowered the TTL to 300 seconds before the switch, the rollback takes minutes to hours. Keep the original DNS zone intact, disable DNSSEC if needed, and purge the Cloudflare cache if the domain stays active.

For the hosting side of Next.js behind a CDN, our Vercel vs Cloudflare vs Coolify comparison works through the numbers, and our Coolify VPS tutorial shows how to prepare an origin with HTTPS. If you are still choosing a host, our developer hosting comparison covers plans with SSH and DNS.

Sources#

Official pages consulted on November 6, 2026. Prices checked in November 2026, in US dollars, excluding taxes.