Skip to content

Cloudflare guide: setup, performance and security

Cloudflare guide: setup, performance and security

This article has been updated to reflect Cloudflare’s latest features and recommended practices. (3 December 2026)

Cloudflare is a massive “connectivity cloud” that acts as both a shield and a turbo engine between your website and its visitors. Once Cloudflare is in place, all your site’s traffic passes through its global network. This means malicious traffic can be stopped before it ever reaches your origin server, while content is served to visitors from the servers closest to them.

In this guide I go through setting up Cloudflare step by step, the right DNS settings, SSL encryption and advanced features such as Argo Smart Routing.

The Cloudflare logo, an orange cloud above the Cloudflare wordmark

Setting up Cloudflare: what you need first

Before you start the set-up itself, there are a few things to prepare. The first step, naturally, is to create a Cloudflare account on its website. After that, you need access to your domain registrar’s control panel (for example Tuonetti or another provider), so that you can change the name servers later.

An important warning about DNSSEC:
If DNSSEC (Domain Name System Security Extensions) is turned on at your current registrar, it absolutely must be turned off before you change the name servers. If DNSSEC is left on, your site will stop working after the name server change, because the new signatures won’t match.

It is also highly advisable to take a backup or a screenshot of your current DNS records before you make any changes.

Changing the name servers and setting up DNS records

A full Cloudflare set-up (Full Setup) requires your domain’s traffic to be routed through Cloudflare. You do this by changing your domain’s name servers.

When you add a site to Cloudflare, it automatically scans your existing DNS records. The scan is usually accurate, but it is up to you to make sure every record has come across correctly. Incorrect records can lead to DNS_PROBE_FINISHED_NXDOMAIN errors.

Check these settings in particular:

  • A records and CNAME records: make sure your website traffic (for example www and the root domain) is “proxied”, in other words shown with the orange cloud.
  • MX records (email): email traffic must go straight to your email provider, not through Cloudflare’s proxy. Make sure the email records (mail, MX) are set to “DNS only” (the grey cloud icon).

Once you have checked the records, Cloudflare gives you two new name servers. Replace the old name servers with these new addresses in your domain registrar’s control panel. The change can take anything from a few minutes to 24 hours to take effect.

Protecting your site: WAF, bots and geo-blocking

One of Cloudflare’s biggest benefits is the security it provides. The Web Application Firewall (WAF) is a powerful feature that protects your site from common threats such as SQL injection and XSS (cross-site scripting) attacks.

With the WAF you can also create custom rules. If your site gets a lot of junk traffic from a particular country, for example, you can use geo-blocking. You can then either block traffic from that country completely or set a challenge (Managed Challenge / CAPTCHA) for visitors coming from there.

It is also worth turning on Bot Fight Mode. It recognises known malicious bots and stops them reaching your site, which saves server capacity and makes your site more reliable.

SSL/TLS settings: why Full (Strict) is the right choice

SSL/TLS settings are critical for security and encryption. Cloudflare offers several encryption modes, but the wrong choice can leave your site vulnerable or break it altogether.

  • Flexible: traffic between the visitor and Cloudflare is encrypted, but traffic between Cloudflare and your server is not. This is not recommended, as it leaves a gap for man-in-the-middle attacks.
  • Full (Strict): this is the only right choice for a live site.

I recommend always using Full (Strict) mode. It requires a valid SSL certificate on your origin server (for example a free Let’s Encrypt certificate or Cloudflare’s own Origin Certificate). Full (Strict) gives you complete end-to-end encryption and verifies that the server’s certificate is genuine.

Performance optimisation: CDN, caching and Brotli

At the heart of Cloudflare is its CDN (Content Delivery Network). It caches your site’s static content (such as images, stylesheets and JavaScript) on hundreds of servers around the world.

You can make your site faster with these settings in the Cloudflare dashboard:

  1. Brotli compression: Brotli is a modern compression method that is more efficient than traditional Gzip. There is no longer a separate switch for it: Cloudflare compresses content by default (with Brotli on the Pro and Business plans and with Zstandard on the Free plan).
  2. Browser Cache TTL: sets how long the visitor’s browser keeps files in its cache. A longer time (for example one month for static files) considerably improves the experience for returning visitors.

Argo Smart Routing: is it worth paying for?

On top of the basics, Cloudflare offers a paid feature called Argo Smart Routing. Argo analyses network traffic in real time and sends data along the most efficient, least congested routes.

Argo is especially useful for dynamic sites that can’t be fully cached. It improves the TTFB (Time to First Byte) considerably. Tests have found an average drop of as much as 40% in response times, and the improvement can be 25–75% depending on how far the visitor is from the server.

Price: Argo is not included in the free plan, and it is now sold as part of the Smart Shield + Argo package. It is billed as a minimum fee (from $5 a month) plus a usage-based data transfer price ($0.10 per GB). For small sites the cost is negligible, but for sites with heavy traffic it can become significant.

For developers and businesses: Cloudflare Zero Trust and Workers

In today’s online environment, protecting the website alone isn’t always enough. Cloudflare Zero Trust is a security framework that replaces traditional VPN solutions. It makes secure remote working and the protection of internal resources possible, for example with the Cloudflare One Client (formerly WARP).

For developers, Cloudflare offers the Workers platform, which lets you run code directly on Cloudflare’s edge servers (serverless). Together with R2 storage, it is an efficient and affordable alternative to traditional cloud services.

Would you like help with the set-up?

If you’re unsure about Cloudflare’s DNS settings or SSL modes, I can help you set them up correctly as part of my security services.

Frequently asked questions about setting up Cloudflare

Why do I need to turn off DNSSEC before setting up Cloudflare?

DNSSEC makes the name server change fail if the signatures don’t match. If you don’t turn DNSSEC off before switching your name servers to Cloudflare, your site stops working until a new validation has been completed.

Which SSL setting should I use in Cloudflare?

The recommended setting is Full (Strict). It requires a valid SSL certificate on your server, but it gives you the strongest security and encrypts the traffic all the way.

Does Cloudflare slow my site down?

Quite the opposite. Configured correctly, Cloudflare speeds your site up by using its global CDN network, caching static content and using fast technologies such as Brotli compression.

Blog

Read next

All articles
Google Tag Manager: what it is and how to use it

Guides

Google Tag Manager: what it is and how to use it

Google Tag Manager transforms the way digital marketing work gets done. In this guide I explain what GTM is, why every website needs it and how to set it up step by step, from installation all the way to the Consent Mode v2 settings.

How to stop spam on your WordPress site

Guides

How to stop spam on your WordPress site

Spam is one of the most common headaches for anyone who runs a WordPress site, but today it is easier to fight than ever. This guide covers the most effective ways to stop spam on your WordPress site, from good-quality web hosting to smart plugins and privacy-friendly CAPTCHA alternatives.

What is DNS?

Guides

What is DNS?

Without DNS, we would have to remember long strings of numbers to visit websites. This article explains in plain language what DNS is, how a lookup happens in milliseconds and why optimising your name server settings can make your browsing faster and safer.

Need a hand with this? Ask me.

Tuomas LindroosI answer myself, usually within two hours. You can also send a message through the contact form.