Line
Skip to main content
< All Topics
Print

Step by step guide setup Cloudflare proxy with cPanel

Here’s a step-by-step guide to set up Cloudflare Proxy with a cPanel account. This will allow your domain traffic to be routed through Cloudflare, enabling CDN, DDoS protection, and performance benefits.


Step 1: Create a Cloudflare Account

  1. Go to https://www.cloudflare.com

  2. Click Sign Up and create your account.

  3. Verify your email address.


Step 2: Add Your Domain to Cloudflare

  1. After logging in, click “Add a Site”.

  2. Enter your domain name (e.g., yourdomain.com), then click Add Site.

  3. Choose a plan (Free plan is usually sufficient to start).

  4. Cloudflare will scan your DNS records. Click Continue after the scan completes.


Step 3: Update DNS Records on Cloudflare

  1. Cloudflare will display your DNS records (imported from your current DNS).

  2. Verify these records:

    • A record pointing to your server IP (get it from cPanel).

    • CNAME records, MX records, etc., if needed.

  3. Make sure the orange cloud ☁️ icon is enabled for the A and CNAME records you want to proxy through Cloudflare.

    • Orange cloud = Proxied (Cloudflare enabled)

    • Grey cloud = DNS only (no Cloudflare protection)


Step 4: Change Your Domain’s Nameservers

  1. Cloudflare will give you two nameservers (e.g., sue.ns.cloudflare.com, bob.ns.cloudflare.com).

  2. Log in to your domain registrar (e.g., GoDaddy, Namecheap).

  3. Find the DNS or Nameserver settings.

  4. Replace the current nameservers with the ones provided by Cloudflare.

  5. Save changes.

⏱️ It may take a few hours to 24 hours for DNS to fully propagate.


Step 5: Adjust SSL Settings in Cloudflare

  1. Go to the SSL/TLS tab in your Cloudflare dashboard.

  2. Select the SSL mode:

    • Flexible – if your server doesn’t have SSL.

    • Full – if your cPanel server has SSL (even self-signed).

    • Full (Strict) – if your cPanel has a valid CA-issued SSL certificate (***recommended***).

  3. For Full (Strict) mode, it is recomended by Cloudflare to perform the following setup. We however we make use of cPanel autoSSL and not to perform the following configurations as it will slow down your website loading speed (by more then 3 seconds).
    • Under Cloudflare
      • Goto SSL/TLS->Original Server to generate an Origin Certificate,
      • Choose RSA (2048) as the Private Key Type.
      • Keep List the hostnames as provided.
      • Choose 15 years Certificate Validity.
      • Click on the Create button.
    • Under cPanel
      • Goto Security->SSL/TLS,
      • Click “Manage SSL sites” under “Install and Manage SSL for your site (HTTPS)”.
      • Scroll to Install an SSL Website.
      • Select the correct domain.
      • Paste the contents:
        • Certificate (CRT): Paste the Origin Certificate.
        • Private Key (KEY): Paste the Private Key from Cloudflare.
        • Certificate Authority Bundle (CABUNDLE):
          • Optional: You can leave this blank or paste Cloudflare’s CA bundle (see below).
      • Click Install Certificate.
  4. Enable Always Use HTTPS and Auto HTTPS Rewrites under the Edge Certificates sub-tab if needed.


Step 6: Configure cPanel (Optional for SSL/Redirects)

If you’re using Let’s Encrypt or AutoSSL on cPanel:

  1. Ensure AutoSSL is set up via WHM or cPanel > SSL/TLS Status.

  2. Force HTTPS redirection via .htaccess or cPanel > Domains > Enable “Force HTTPS Redirect”.

To avoid redirect loops:

  • If using “Flexible” mode, don’t redirect to HTTPS on the server side; Cloudflare handles it.

  • Prefer Full (Strict) if possible to avoid these issues.


Step 7: Test Everything

 

Messenger