Cloudflare is a free CDN and security service that sits between your visitors and your server. It can speed up your website, protect against DDoS attacks, and provide free SSL. This guide explains how to set up Cloudflare with your Allanux Web hosting account.
Step 1: Create a Cloudflare Account
- Go to cloudflare.com/sign-up.
- Create a free account using your email address.
Step 2: Add Your Domain
- Click Add a Site and enter your domain name.
- Select the Free plan.
- Cloudflare will scan your existing DNS records.
- Review the DNS records and ensure they match your cPanel records. The key records to check:
- A record: should point to your Allanux Web server IP
- MX records: should point to your mail server
- TXT record: should include your SPF record
- CNAME record: for www (if applicable)
- Click Continue.
Step 3: Change Nameservers
- Cloudflare will provide two nameservers (e.g.,
linda.ns.cloudflare.comandsean.ns.cloudflare.com). - Go to your domain registrar (where you purchased your domain).
- Change your domain's nameservers to the Cloudflare nameservers.
- Wait for propagation (up to 24 hours).
- Cloudflare will email you when the nameservers are active.
Step 4: Configure Cloudflare Settings
Once active, configure these settings in the Cloudflare dashboard:
- SSL/TLS: Set to
FullorFull (Strict)— do not use "Flexible" as it can cause redirect loops. - Always Use HTTPS: Enable under SSL/TLS → Edge Certificates.
- Auto Minify: Enable for HTML, CSS, and JavaScript (Speed → Optimization).
- Cache Level: Set to "Standard" (Caching → Configuration).
- Page Rules: Create a rule to cache static files (CSS, JS, images) for better performance.
Step 5: Update DNS Records in Cloudflare
Any future DNS changes should be made in Cloudflare (not cPanel), since Cloudflare is now your DNS provider:
- To add a subdomain: add an A record in Cloudflare pointing to your server IP.
- To add MX records for email: add them in Cloudflare DNS settings.
- Changes in Cloudflare take effect within seconds (unlike traditional DNS which takes hours).
Important Notes
- After switching to Cloudflare, manage DNS in Cloudflare, not cPanel Zone Editor. Cloudflare is now your authoritative DNS.
- Cloudflare's free SSL covers traffic between visitors and Cloudflare (not end-to-end). Your origin server should also have SSL for full security.
- If you use cPanel email, ensure your MX records are correctly set in Cloudflare. Cloudflare's proxy (orange cloud) does NOT proxy email traffic — MX records work normally.
- Set SSL mode to Full (Strict) only if you have a valid SSL certificate on your Allanux Web server. Use Full if your server has a self-signed certificate or no SSL.
Troubleshooting
- "Too many redirects" error: SSL mode is likely set to "Flexible" while your server has SSL. Change to Full or Full (Strict) in Cloudflare → SSL/TLS.
- Website not loading after Cloudflare setup: Check that the A record in Cloudflare points to the correct server IP. You can find your server IP in cPanel (right sidebar) or by contacting support.
- Email stops working after enabling Cloudflare: MX records may be missing or incorrect in Cloudflare. Go to Cloudflare → DNS and add your MX records. Do NOT proxy (orange cloud) MX records — set them to DNS only (grey cloud).
- Cloudflare cache showing old content: Purge the cache in Cloudflare → Caching → Purge Everything. Also check Page Rules are not caching dynamic pages.
- "Error 522: Connection timed out": Cloudflare cannot reach your server. Verify the A record IP is correct and that your server is online. Also check that your firewall (CSF) is not blocking Cloudflare's IP ranges.
Need help? Contact our support team.