If you’re looking to improve the performance and security of your website, Cloudflare’s free plan is a fantastic option. It’s something I use for every website I build or manage, and the benefits are significant. While the idea of managing DNS settings can feel intimidating, the process is actually quite simple. In this guide, I’ll walk you through how to set up your free Cloudflare account and migrate your website to it step by step.
Why Use Cloudflare?
Cloudflare offers a range of benefits, even on its free plan. It helps improve your website’s performance, enhances security, and makes managing DNS records easier. Once your site is set up, you’ll notice faster propagation times for DNS changes, and your site will be better protected against threats like DDoS attacks.
Getting Started
To begin, you’ll need access to your domain registrar account. For this example, I’ll be using Namecheap, where I’ve registered the domain theadmin.bar. Currently, the domain is using Namecheap’s default name servers, and I have two DNS records set up:
- An A record pointing to my server’s IP address.
- A CNAME record for the
www
version of the domain.
Step 1: Create a Cloudflare Account
Head over to Cloudflare.com and click Sign Up. Enter your email address and create a password to set up your account. Once you’ve signed up, you’ll be prompted to add your website.
Enter your domain name (e.g., theadmin.bar) and click Continue. On the next screen, make sure the free plan is selected, then hit Continue again.
Step 2: Import and Review DNS Records
Cloudflare will automatically scan your existing DNS records and attempt to import them. While this is convenient, it’s always a good idea to manually review the records to ensure accuracy.
In my case, Cloudflare imported some outdated records that were no longer relevant. If this happens to you, simply delete any unnecessary records and add the correct ones. For example:
- Add an A record with the
@
symbol pointing to your server’s IP address. - Add a CNAME record for
www
pointing to your domain name.
Once your DNS records are set up correctly, click Continue.
Step 3: Update Name Servers
Cloudflare will provide you with two name servers to replace your current ones. Copy these name servers and head back to your domain registrar (in my case, Namecheap).
In your registrar account:
- Navigate to the domain settings.
- Change the name server type to Custom DNS.
- Paste the two Cloudflare name servers into the fields provided.
- Save your changes.
After updating your name servers, return to Cloudflare and click Check Name Servers.
Step 4: Wait for Propagation
DNS changes can take anywhere from 15 minutes to 24 hours to propagate, depending on your registrar. Cloudflare will monitor the changes, and once the name servers are updated, you’ll receive an email notification confirming that your site is active on Cloudflare.
Step 5: Configure Basic Cloudflare Settings
Once your site is active, Cloudflare will guide you through a quick setup process. Here are a few key settings to enable:
- Automatic HTTPS Rewrites: This ensures that all URLs are rewritten to use HTTPS, helping to prevent mixed content issues.
- Always Use HTTPS: This creates a rule to redirect all HTTP traffic to HTTPS.
These settings are simple but effective for improving your site’s security and performance.
Step 6: Install the Cloudflare Plugin for WordPress
If your website runs on WordPress, you can take things a step further by installing the official Cloudflare plugin. This plugin allows you to manage your Cloudflare settings directly from your WordPress dashboard.
To install the plugin:
- Log in to your WordPress site.
- Go to Plugins > Add New.
- Search for “Cloudflare” and install the official plugin by Cloudflare Inc.
- Activate the plugin.
Once activated, navigate to the Cloudflare settings in your WordPress dashboard. You’ll need to connect the plugin to your Cloudflare account by entering your email address and API key.
To find your API key:
- Log in to your Cloudflare account.
- Click on your profile in the top-right corner.
- Select API Tokens and copy your Global API Key.
Paste the API key into the plugin settings and save.
Step 7: Apply Recommended Settings
The Cloudflare plugin includes an option to apply recommended settings for WordPress. Click the button to enable these settings, which will optimize your site’s performance and security.
The plugin also allows you to purge your Cloudflare cache directly from your WordPress dashboard. This is useful when making updates to your site, as it ensures visitors see the latest version of your content.
Additional Features
Once your site is set up on Cloudflare, you’ll have access to several additional features:
- Turnstile CAPTCHA: Cloudflare’s CAPTCHA alternative is a great way to enhance security on your site. I’ll cover how to set this up in a future guide.
- Invite Team Members: You can invite others to manage your Cloudflare account with specific permissions. This is especially helpful for collaborating with clients or third-party vendors.
Wrapping Up
Setting up your website on Cloudflare’s free plan is a straightforward process that offers significant benefits. From improved performance to enhanced security, Cloudflare is a tool I use on all my websites, and I highly recommend it.
By following the steps outlined in this guide, you can confidently get your site up and running on Cloudflare. Stay tuned for more tips and tutorials on how to make the most of this powerful platform!