How to Set Up Cloudflare CDN with SiteGround Hosting (Step-by-Step)

Set Up Cloudflare Cdn With Siteground
Follow Us:
2.7k
16.4k
14.1k
200
4.1k

I don’t know about you, but for me, the term “content delivery network” always sounded like heavy-duty enterprise lingo; something reserved for businesses with sizable IT budgets, hardly for an aspiring tech writer with a measly website. But when Cloudflare crashed the party, it all changed. The company promised to speed up delivery by caching any site across a global network of edge servers.

Cloudflare also blocks malicious traffic before it ever hits a web host. But what really got my attention was something else: Cloudflare would do all of that for zero dollars. Of course, I became a user. A decade and a half later, I still am. So, if you’re ready to receive improved page speeds, reduced server load, a shared SSL certificate, and DDoS protection with Cloudflare, buckle your proverbial seat belt.

Add to Preferred Sources

Step 1: Prepare Your Website Before Connecting Cloudflare

“Preparation is the key to success,” said a very smart guy named Alexander Graham Bell. I’ll be connecting a SiteGround-hosted website to Cloudflare, updating DNS settings, enabling SSL, and verifying the CDN is working as it should. But first, prepare your site.

Image showing a default “Awesome Site in The Making” placeholder page with a light blue illustrated background of a monitor with gears and paper airplanes, stating that a site is coming to this web address, which can appear in place of the live website while DNS or nameserver changes are still resolving.

By the way, if you’re not already using SiteGround, now is the best time:

SiteGround.com

SiteGround Review

Monthly Starting Price $1.99

Visit Site »
  • AI Studio: models, agents & Coderick AI site builder
  • FREE website transfer service to get started
  • 99.9% uptime guarantee and unlimited traffic
  • 24/7 support featuring custom systems
  • WordPress, 4 caching options, plus staging and Git
  • Get started on SiteGround now.
Our Expert’s Review ★★★★★ 4.9/5.0

Lynn Cadet

(HostingAdvice.com): Providing hosting with the perfect balance of technological innovation and superior customer support, SiteGround offers a range of affordable hosting services to meet your needs. In addition to the expected cheap web hosting perks — a free website builder and unlimited bandwidth — the company specializes in custom-built tools to deliver strong and positive user experiences. Go to full review »

Money Back Guarantee Disk Space Domain Name Setup Time
30 days 10 GB SSD – 100 GB Google Cloud SSD FREE (1 Year) 6 minutes

Back to it. I’m a fan of analogies, so let’s just say it’s wise to check our SiteGround wires before calling Cloudflare.

And that means a pre-check list:

  1. Confirm the website is live on SiteGround: Fire up your browser and type in your domain. If you see any sort of message, be it a server error or under construction like the teal one above, fix that on SiteGround first.
  2. Verify the domain is active: Cloudflare needs to communicate with your domain registrar, so if your domain is expired or stuck in administrative limbo, the setup process will stall.
  3. Review existing DNS records: In the Websites section, you’ll see a delightfully lavender-like purple button called Site Tools next to your website. This is SiteGround’s control panel. When you click on it, go to the Domain section in the left, grey sidebar. There, you’re looking for the DNS Zone Editor to take stock of your current setup.
  4. Note the current nameservers: In Site Tools, grab the existing SiteGround nameservers from the main dashboard window. You’ll find them in the Site Information box, as seen below in one of the many screenshots I’ve taken: Having these on hand allows you to revert to your default settings in case anything goes sideways.

Why, you may ask? It’s true that Cloudflare’s automated scanner does a decent job copying your records over, but I’m a big believer in doing due diligence. Missing records can be a major pain in the derrière.

Image showing the SiteGround Site Tools dashboard with pinned tools for WordPress, Email Accounts, File Manager, Site Scanner, and SuperCacher, and a Site Information section listing disk usage, the site IP address, and the default SiteGround name servers ns1.siteground.net and ns2.siteground.net.

I know all of this might seem like a chore, but only a live and healthy site is clear for CDN-bound takeoff.

Step 2: Add Your Domain to Cloudflare

Head on over to Cloudflare and create an account (it’s free). I’m boldly assuming you don’t have one. If you do, log in.

Image showing the Cloudflare homepage with an orange hero banner headlined “Everything we learned from powering 20% of the Internet—yours by default,” a “Start building for free” button, and top navigation for Products, Solutions, Resources, Pricing, Login, and Contact sales.

When you get in, you’ll be greeted with this sight:

Image showing the Cloudflare dashboard account home with a “Shipping today?” search bar and three cards for shipping a new app, adding a domain with free DNS, automatic HTTPS, and DDoS protection, and protecting apps and users, along with the left sidebar for Domains, Analytics, Application security, and Delivery & performance.

Click on the Add a domain section, and then you’ll see Connect your domain.

Type in your domain without www, https://, slashes, or anything else. Cloudflare will take a second or two to recognize it. Once it does, it will provide a blue “Connect” button for you to click (it will appear beneath the text box).

Image showing the Cloudflare “Connect your domain” page with journalancer.com entered in the domain name field, AI training and search bot policies set to recommended defaults, the robots.txt training block toggled on, DNS record import set to Automatic, and a blue Continue button.

Cloudflare will ask how you want to handle automated bots and AI crawlers. I usually go with recommended settings at this point.

Note: If you choose to block “crawlers that scrape content to to train AI,” it may block Googlebot and affect your Google search ranking.

It will automatically import DNS records as well, though you can add them manually after setup or upload a DNS zone file in BIND format. Click “Continue” to proceed once you’ve made the tweaks.

As expected, Cloudflare will try to get you on one of its paid plans full of corporate-oriented features. They have to pay bills somehow, after all.

Image showing the Cloudflare plan selection page for journalancer.com comparing the Free, Pro, Business, and Enterprise plans, with the free plan’s universal SSL certificate, global CDN, and DNS listed alongside the WAF, bot protection, and support features added in each paid tier.

You almost certainly don’t need these right now. The “Free” plan will do the trick, since it includes full access to the global CDN, along with shared SSL and Cloudflare WAF customization (limited, but still).

Step 3: Verify Imported DNS Records

Like a solid private detective, the platform will dig up every DNS record associated with your site:

  • Your IP addresses (A records)
  • Subdomains (CNAMEs)
  • Email settings (MX records)
  • Verification tags (TXT records)
Image showing the Cloudflare “Review your DNS records” page for journalancer.com, listing the scanned A, CNAME, MX, and TXT records, a warning to compare them against the current DNS provider, an explanation of proxied versus DNS-only traffic, and A records pointing to the hosting server IP with orange-cloud proxy status turned on.

The automated scanner isn’t flawless, so common sense dictates that you manually verify that the records it found match those in SiteGround.

I’ll stress once more the importance of doing so. The moment you change your nameservers in the next step, Cloudflare takes full control of your traffic. If something is missing or factually incorrect, the fallout can take your website offline, break your custom email routing, disconnect third-party services, and wreak other havoc.

Double-check these four DNS records:

  1. Verify A records: Compare the IP address shown in Cloudflare to the one in your SiteGround Site Tools dashboard.
  2. Review CNAME records: There should be a CNAME record for www that points back to your root domain. That way, even if some of your visitors prefer to keep it old school and type ‘www’ in their browsers, they’ll end up at your site.
  3. Check MX records: If you’re using email, all MX records should be transferred over, whether you host your email directly on SiteGround or use a third-party service.
  4. Confirm TXT records: Skim the list if only to be certain that none of these long, messy strings of text were left behind

If everything is to your satisfaction, press “Continue to activation”.

Step 4: Update Your Domain’s Nameservers

When figuring out how to set up Cloudflare on SiteGround, this is the part where you de facto hand over the keys. But for the former to take the steering wheel from your host, you have to swap out your old nameservers for Cloudflare’s custom set.

No problemo. As you can see, Cloudflare will display two unique nameservers specifically generated for my site. These are gabe.ns.cloudflare.com and mallory.ns.cloudflare.com, so I’ll need to copy them. Don’t close this tab yet.

Image showing the Cloudflare “Update your nameservers to activate Cloudflare” page with instructions to log into the domain registrar, replace the current nameservers with the two assigned Cloudflare nameservers shown in copyable fields, delete any other nameservers, and save the changes, plus a recommendation to turn off DNSSEC.

Next, head on to your domain registrar and log in. If you registered your domain directly through SiteGround, navigate to Services, then Domains, and click Manage for your respective domain.

If you bought it from another domain registrar like Namecheap or GoDaddy, find your way to the DNS or Nameserver management settings.

Depending on your domain registrar, there will be some differences in the dashboard and settings layout. Use the search bar or look for an option that says “Use custom nameservers” or “Edit Nameservers”. Something to that effect. In any case, delete the existing nameservers and paste the new Cloudflare ones.

Of course, save the changes. You might get a message letting you know that changing nameservers takes time, which is perfectly fine. We’ll get to DNS propagation in the next step.

From that moment on, Cloudflare becomes your site’s authoritative DNS provider.

Before I close the book on this chapter, you’ll need to let Cloudflare know that you’ve done the legwork. This means going back to that particular tab and clicking the “I updated my nameservers” button at the bottom of the page. Keep this tab open, as we’ll have more work to do here.

Step 5: Wait for DNS Propagation

Following the successful handoff, you enter a mild digital version of the Twilight Zone known as DNS propagation. It’s the period where global ISPs update their local address books to recognize that Cloudflare is now in charge.

In most instances, your domain will start resolving within 15 to 30 minutes, though global completion varies based on server caches around the world, sometimes up to 48 hours. The typical wait-and-see time frame you’ll see is 24 hours.

Image showing the Cloudflare overview page for journalancer.com waiting for the registrar to propagate the new nameservers, with a “Check nameservers now” button, next steps for verifying DNS records and managing the free universal SSL certificate under SSL/TLS, and a sidebar showing Full DNS setup and the active Free plan.

Cloudflare will tell you when the handoff is official. But if you’re impatient like I am, click the “Check Nameservers Now” button for a manual check. The dashboard will display a green Active status when the switcheroo is made. You can also monitor activation from the domain’s Overview page.

If you want to take it a step further, free DNS propagation tools like whatsmydns.net and dnschecker.org allow you to confirm global DNS updates.

Image showing the whatsmydns.net global DNS propagation checker running an NS lookup for www.journalancer.com, with a list of test locations across the United States, Canada, Mexico, Brazil, and Europe, nameserver results marked by green checkmarks or red Xs, and a world map tracking how far the DNS change has spread.
Source: whatsmydns.net

Just select NS (Nameservers) from the dropdown menu next to your domain (as above), and you’ll see a blue world map. If it’s anything like mine, it will light up with green ticks. These indicate regional DNS resolvers that dropped your old SiteGround nameservers and started returning Cloudflare.

Word of advice: let your DNS settings be during propagation. No touching, clicking, or fiddling around, even if it’s to toggle security options. These can confuse local resolvers that are mid-update and reset the clock.

Step 6: Configure SSL and Performance Settings

Now that you’ve waited for propagation and you have the all-clear Active status, we can dig back into settings. With Cloudflare and SiteGround talking to each other, you’re good to start tinkering under the hood. There are more than enough options for you to play with.

I’ll stick with the most important settings:

Select the Appropriate SSL Mode

We do this to prevent certificate and redirect issues. Under Domains, click on your respective website, and go to the Overview tab in the SSL/TLS section. There, you’ll see your Current encryption mode. Mine is set to “Full” at the moment.

Image showing the Cloudflare SSL/TLS overview page for journalancer.com with the current encryption mode set to Full, illustrated by a diagram of encrypted connections from the browser to Cloudflare and from Cloudflare to the origin server, plus a Configure button and a Traffic Served Over TLS panel.

If you click on “Configure” in the upper-right corner, a full array of encryption modes will be presented.

Since SiteGround automatically issues a free Let’s Encrypt SSL certificate to the origin server, choose “Full (strict)” as your option. This way, Cloudflare will encrypt the connection and strictly verify the origin SSL certificate, which isn’t the case with the “Full” mode.

Enable Automatic HTTPS Rewrites

Immediately below the Overview tab, head into Edge Certificates and scroll down to turn on the “Automatic HTTPS Rewrites” feature.

Image showing the Cloudflare Edge Certificates page under SSL/TLS for journalancer.com with TLS 1.3 and Automatic HTTPS Rewrites toggled on to fix mixed content by changing HTTP links to HTTPS, along with Certificate Transparency Monitoring switched off and the Disable Universal SSL option.

Since you’re in there, flip on “Always Use HTTPS”. It automatically forces all insecure http:// traffic over to https:// and fixes annoying “mixed content” warnings caused by old, non-secure image or script links embedded in your code.

Configure Caching

Move on down the list to the Caching tab and click on Configuration. You can leave your Caching Level set to “Standard”, so that Cloudflare can instantly cache all your static assets like images and JavaScript across its global edge network. Plus, it does so without breaking dynamic content like blog comments or shopping carts.

Image showing the Cloudflare cache Configuration page under the Caching menu for journalancer.com on the free plan, with Custom Purge and Purge Everything buttons for clearing cached files, the Caching Level set to Standard, and the Browser Cache TTL set to 4 hours for faster repeat page loads.

One more thing you can do here is tweak Browser Cache TTL to instruct returning visitors’ browsers to store (cache) static files locally.

For static assets, 1 year is the sweet spot. Or choose “Respect Existing Headers” if your origin server handles versioned assets properly.

Note: A much shorter TTL of one hour to one day prevents users from seeing stale content for HTML and frequently updated pages.

Turn on Early Hints

Go to Speed > Settings, then click on the Content Optimization tab where you’ll find Early Hints. Toggle it “on”.

Image showing the Cloudflare Speed settings page for journalancer.com with performance toggles for Cloudflare Fonts, Early Hints for preloading linked assets with 103 responses, a Smart Hints beta sign-up, and Rocket Loader for faster JavaScript page rendering, all currently switched off.

The feature allows Cloudflare to tell the browser to start preloading critical CSS files, fonts, and scripts, thus boosting the page loading speed.

Finally, I’ll throw some basic security stuff your way. You’ll find these under Security > Settings. As is the case with Cloudflare, it’ll automatically protect your domain from malicious traffic, so technically, you don’t need to touch anything. Still, there are options to configure several rules for more tailored protection.

Step 7: Test Your Website

The first time I went through all of the above, I was tempted to go for a celebratory snack. Hang in there a bit longer for some testing.

A few minutes auditing your live website is time well spent, as I’m certain you’ll agree.

For starters, visit your site over HTTPS. Open an incognito/private window and manually type your URL using https://. This makes sure the site resolves instantly without throwing an error or an infinite redirect loop. Another trick I’ll throw your way is to type “?nocache” with the question mark directly after your URL in your normal browser.

In the address bar, click on the ever-present “tune” icon in Chrome (or padlock) icon to the left of the URL to verify the SSL certificate. Different browsers will have slightly different paths. Click on “Connection is secure” and “Certificate is valid” to confirm that your traffic is passing through Cloudflare’s edge proxy.

Set aside a minute or two to click through a handful of pages across your website. Pay attention to whether fonts, stylesheets, images, and other elements load without missing stuff or layout glitches. Then, test your dynamic content (e.g., add an item to a cart if you’re running an online shop) and fill out your forms to see if email works as it used to.

For hard proof that Cloudflare is serving cached assets, right-click anywhere on your homepage and select Inspect.

Note: If you’re using Safari on an Apple device, you’ll have to enable developer settings. Click Safari > Settings > Advanced and check “Show features for web developers”.

I would stick to Chrome. Select the Network tab and refresh the page. You’ll see a list of loaded elements.

Image showing Chrome DevTools open to the Network tab on journalancer.com, listing page requests with their status codes, file types, sizes, and load times, many scripts served from memory cache, and a summary bar with 40 requests, 1.0 MB transferred, DOMContentLoaded at 2.71 seconds, and a full load time of 3.59 seconds for testing site speed after enabling Cloudflare.

Find an image, CSS, or JS file and click on it. The Response Headers section on the right should show cf-cache-status: HIT for your static assets, which means Cloudflare is officially in the business.

Troubleshoot: Cloudflare and SiteGround Issues

Not to rain on your parade, but you may need to bookmark this article. Hopefully, we’re all set, but changing DNS providers can cause an issue here and there.

If you have further issues, here are my solutions:

  • Website unavailable after changing nameservers: DNS propagation is usually the culprit. Scan your domain with a DNS propagation checker to see if global servers are returning Cloudflare’s nameservers. Check for sneaky extra spaces or typos in the nameserver fields as well.
  • SSL or redirect errors: The encryption modes are likely clashing. Take the familiar path of SSL/TLS > Overview and switch your encryption mode to “Full (strict)” for unbroken HTTPS traffic.
  • Missing DNS records: Chances are, a record was left behind during setup. A neat “trick” is to open two tabs side-by-side (Cloudflare’s DNS > Records page and SiteGround’s DNS Zone Editor for your domain) and manually add whatever is missing.
  • Email no longer working: Either your MX records didn’t copy over, or your mail subdomains are incorrectly routed through Cloudflare’s proxy shield. Check that your MX records are present in Cloudflare’s DNS tab. Next, look at an A or CNAME record for the mail domain and set its proxy status to “DNS Only” (grey cloud icon), not “Proxied” (orange cloud icon).
  • CDN changes not appearing: In Cloudflare, navigate to Caching > Configuration, then click “Purge Everything” to force Cloudflare to fetch fresh files from SiteGround.

As you can see, 99% of setup issues have fairly simple remedies, so no need to worry (much).

Your SiteGround Website Is Now Using Cloudflare

That concludes our little get-together on how to set up Cloudflare on SiteGround.

One more thing.

As your traffic scales, don’t stop at the default settings. I say this as a dedicated user. Heck, I’m even writing for a living on how to set up Cloudflare on SiteGround, if you can believe it.

You’ve likely noticed that Cloudflare has quite an expansive toolkit, so use it:

  • Tweak page behaviors with Page Rules
  • Lock down complex threats using the WAF
  • Dig into real-time analytics, and do all sorts of things.

When you’re ready to dive deeper into optimizing your online presence, check out our library of tutorials on WordPress, hosting management, AI deployment, and a whole lot more. Plus, we share more expert tips on social media, so give HostingAdvice a follow.

Thanks for reading, and enjoy your new CDN!