How to connect a site to Cloudflare (WHS panel and cPanel)

Cloudflare stands in front of your site: visitors first arrive at the Cloudflare network, and only then does it ask your server. You get faster loading from the cache closer to the visitor, attack protection and free DNS. The basic package is free and sufficient for most sites.

How Cloudflare works with your domain

  • The domain's nameservers go to Cloudflare. From that moment on, you change DNS records (A, MX, TXT) on Cloudflare, not in the panel.
  • Orange Cloud (Proxied, „Via Cloudflare“) means that the traffic goes through Cloudflare and the real IP address of the server is hidden. Gray Cloud (DNS only) means that Cloudflare only resolves the name.
  • Mail records (mail, MX, autodiscover) must remain on the gray cloud, otherwise mail stops working.
  • SSL mode on Cloudflare set to Full or Full (strict). Flexible mode does an infinite redirect when Force HTTPS is enabled on the server.

How to add a domain to Cloudflare

  1. Create a free account at cloudflare.com.
  2. Click Add a domain, enter the domain and select Free plan.
  3. Cloudflare itself reads the existing DNS records. Check that there is an A record for the site and MX for the mail, and that the mail is on the gray cloud.
  4. Cloudflare gives you two nameservers. Enter them at the domain registry instead of ours. If the domain is with us, see Changing nameservers.
  5. After a few hours (with .rs domains often even faster) Cloudflare reports that the domain is active.

First log in to your panel

Log in client panel, for hosting click Edit, so AutoLogin Panel. In detail: Reset Password Panel or AutoLogin Panel.

What panel are you using? Click and go directly to your instruction.

Don't know which one you have? The WHS panel has a menu on the left (Control Panel, Domains, Email...). cPanel on the home page has icons arranged by groups (Email, Files, Databases, Domains) and the inscription cPanel at the bottom of the page.

WHS panel

Cloudflare in the WHS panel

The WHS panel has a built-in Cloudflare integration, so you connect and configure the domain from the panel. Open in the left menu Security well Cloudflare. The table shows for each domain whether Cloudflare is on, SSL mode and proxy.

  1. On Cloudflare, create API token (not Global API Key) with permission Zone, DNS, Edit. Other permissions from the list (Zone Settings, Cache Purge, Firewall, WAF, Bot Management, Analytics) unlock additional functions in the panel. Link Create a token on Cloudflare It leads straight to that side.
  2. In the WHS panel, click on the domain code Turn on.
  3. Paste the token into the field. Cloudflare API token and click Okay.

After connecting, select the mode from the panel Through Cloudflare or DNS only, and the button Refresh status pulls the current state from Cloudflare.

cPanel

Cloudflare and cPanel

cPanel on our servers does not have the Cloudflare plugin built in, so everything is set up on Cloudflare itself (steps above). You don't have to change anything in cPanel for the site to work.

  • After switching nameservers, DNS records from cPanel Zone Editor- and are no longer valid. Record each change (eg new subdomain, TXT for Google or email service) on Cloudflare.
  • When you add a new domain or subdomain in cPanel, add an A record on Cloudflare for it, otherwise it won't open.
  • If cPanel keeps logging you out or looks weird after enabling Cloudflare, open it via AutoLogin Panel from the client panel, or post a record cpanel on a gray cloud.
  • Free SSL on the server (AutoSSL) still works, and it keeps SSL mode on Cloudflare Full.

The site or mail does not work after switching on

The most common causes are: mail records are on the orange cloud (turn them back to gray), SSL mode is Flexible (switch to Full), or Cloudflare has not downloaded a DNS record (add it manually). If you can't find the problem, temporarily pause Cloudflare in its control panel and contact support.