• Are you a developer?

    Be sure to check out our developer page for resources for developing apps and other APIs. You can also check out all of CloudFlare's open source projects it maintains.

CloudFlare resources and downloads

From this page you may download many different tools and plugins for working with CloudFlare.

  • Logging Real Visitor IP Addresses: mod_cloudflare for Apache httpd
    • Description

      Because CloudFlare acts as a proxy, you will notice changes to the way that your website visitors' IP addresses are displayed both in your server logs and web applications - notably that all access appears to be coming from CloudFlare IP addresses. You can read more about the reasons for this in our knowledge base article.

      You can change this behavior and log & display the actual visitor IP addresses by using mod_cloudflare.

      Requirements

      mod_cloudflare supports Apache httpd 2.2.x and 2.4.x. Installation requires root access to the command line of your server via SSH.

      Note: if you use cPanel, follow the proper installation method below. However, if you are a hosting provider, you should install the CloudFlare cPanel plugin instead. Installing the CloudFlare cPanel plugin will automatically install mod_cloudflare. Note that using the CloudFlare cPanel plugin requires that you are a Certified Partner with a Host API Key. You can apply to be a Certified Partner here.

      Installation

      Please choose your desired installation method below. CloudFlare recommends using a manual installation unless you know that Apache httpd and its dependencies have all been installed to your server using your operating system's package management system (such as RPM or DEB) - i.e. not manually compiled and installed.

      Option 1: Installation from Packages

      Download the appropriate package to your web server and install it using your operating system's "rpm" or "dkpg" commands.

      For RedHat / CentOS / CloudLinux:

      # yum install glibc.i686
      # rpm -i mod_cloudflare-elX.latest.rpm

      For Debian / Ubuntu:

      # dpkg -i mod_cloudflare-XXXXX.latest.deb


      Option 2: Installation on cPanel Servers

      cPanel uses a system known as EasyApache to rebuild Apache httpd during updates or certain configuration changes. The below instructions will integrate mod_cloudflare support into EasyApache so that it can be easily included from the cPanel web interface and remain activated in Apache httpd after rebuilds.

      Note: credit for this perl script goes to Tyler Larson at tltech.com.

      # wget https://www.cloudflare.com/static/misc/mod_cloudflare/cloudflare.pl
      # perl cloudflare.pl install

      Alternatively, you can run this instead:

      # perl <(curl -s https://www.cloudflare.com/static/misc/mod_cloudflare/cloudflare.pl) install

      Next, you can use EasyApache, choose to customize your profile, then, on the "Short Options List" screen, checkbox the "Mod CloudFlare" feature, and click "Save and Build".


      Option 3: Manual Installation: RedHat / CentOS / CloudLinux

      mod_cloudflare has a few software dependencies that need to be installed first:

      # yum install libtool httpd-devel

      Next, you should download the mod_cloudflare source to your server:

      # wget https://www.cloudflare.com/static/misc/mod_cloudflare/mod_cloudflare.c

      Finally, install the module. Depending on your system, the command to run might be apxs or apxs2. So, run one of the below two commands. If you get a "Command not found" when running one, try the other:

      # apxs -a -i -c mod_cloudflare.c

      # apxs2 -a -i -c mod_cloudflare.c


      Option 4: Manual Installation: Debian / Ubuntu

      mod_cloudflare has a few software dependencies that need to be installed first:

      # apt-get install libtool apache2-dev

      Note: If you find that you are unable to install apache2-dev then you should install:

      # apt-get install libtool apache2-threaded-dev

      Next, you should download the mod_cloudflare source to your server:

      # wget https://www.cloudflare.com/static/misc/mod_cloudflare/mod_cloudflare.c

      Finally, install the module. Depending on your system, the command to run might be apxs or apxs2. So, run one of the below two commands. If you get a "Command not found" when running one, try the other:

      # apxs -a -i -c mod_cloudflare.c

      # apxs2 -a -i -c mod_cloudflare.c

  • Dynamic Content Caching: Railgun WAN Optimizer
  • Dynamic DNS Client: ddclient
    • Description

      A port of ddclient, this includes support for using the CloudFlare dynamic DNS updating system.

      Requirements

      Perl 5.004 or later (you need the IO::Socket::SSL perl library for ssl-support)

      Installation
      cp ddclient /usr/sbin/
      mkdir /etc/ddclient
      mkdir /var/cache/ddclient
      cp sample-etc_ddclient.conf /etc/ddclient/ddclient.conf
      vi /etc/ddclient/ddclient.conf

      —and change hostnames, logins, and passwords appropriately

      For CloudFlare, this should be:

      ##
      ## CloudFlare (cloudflare.com)
      ##
      ssl=yes
      protocol=cloudflare, \
      server=www.cloudflare.com, \
      login=[email protected] \
      password=my-cloudflare-api-key \
      my-awesome-site.com,

      To run in debug mode:

      ddclient -daemon=0 -debug -verbose -noquiet

      See the docs here for full configuration and installation instructions.

  • ServerShield for Parallels Plesk 12
    • Description

      CloudFlare Extension for Parallels Plesk 12.

  • cPanel Plugin for Hosting Providers
    • Description

      CloudFlare plugin for CPanel. Please note: The cPanel plugin is for Certified CloudFlare Hosting Partners.

      Download Instructions in PDF Format

      Installation

      Using an SSH client such as Terminal or Putty:

      Step 1. Access cPanel for the server using root user by:

      ssh root@SERVER IP ADDRESS or SERVER NAME

      Step 2.

      bash <(curl -s https://raw.githubusercontent.com/cloudflare/CloudFlare-CPanel/master/cloudflare.install.sh) $HOST_API_KEY '$YOUR_COMPANY_NAME'

      To check if it is installed:

      cat /usr/local/cpanel/etc/cloudflare.json

      You should see an output with something similar to:

      root@server1 [/usr/local/cpanel]# cat etc/cloudflare.json
      {
       “host_key”:”32yt5a7b436tuy8974tre -”, (For security purposes, this will not be your host key.)
       “host_formal_name”:”Awesome Hosting”,
       “host_name”:”api.cloudflare.com”,
       “host_uri”:”/host-­gw.html”,
       “user_name”:”www.cloudflare.com”,
       “user_uri”:”/api_json.html”,
       “host_port”:”443”,
       “host_prefix”:”cloudflare-­resolve-­to”,
       “cp_version”:”1.3.0”
      }

      Custom/Additional Themes:

      The CloudFlare plugin is installed into the default 'x3' theme, as well as the new 'Paper Lantern' theme if installed. If you utilize a custom theme or have alternate themes installed, the following command can be used to install the CloudFlare plugin on these themes:

      bash <(curl -s https://raw.githubusercontent.com/cloudflare/CloudFlare-CPanel/master/copy2theme.sh) $BASE_THEME $ALTERNATE_THEME

      $BASE_THEME should be either 'x3' or 'paper_lantern', based on what theme the alternate was based on.

      Replace $ALTERNATE_THEME with the folder name of the alternate theme on your server. This folder should be located at /usr/local/cpanel/base/frontend/$ALTERNATE_THEME/.

  • Interworx (third-party) for Hosting Providers
    • Description

      Interworx has developed a plugin for their hosting provider control panel system. This plugin allows CloudFlare partners to enter their Host API Key and easily allow their customers to sign up for and manage CloudFlare services..

  • ISPsystem for Hosting Providers
    • Installation

      Step 1: Enter the ISPmanager control panel - go to the Server Settings module - the Plug-Ins section. Then, click the Install icon in the upper corner of the toolbar.

      Step 2: In the Plug-ins collection section you can choose a plug-in that you want to install from the available collection of plug-ins. You can also view information about a plug-in, such as its author, programming language that was used to write the plug-in, its functions and other information.

      Step 3: If you want to install the CloudFlare plug-in, select it from the list and click the "Install" icon. A new from will be displayed. Carefully read the information in the form before installation.

      Step 4: Once the installation is complete, the plug-in will be added into the Plug-in management module.

      Step 5: To learn information about a plug-in, select one and click the "Info" icon. The following form will be displayed:

      • Detailed description - description of the plug-in's functionality.
      • Programming language - programming language that was used to write this plug-in.
      • Required modules - supplementary modules that are needed for plug-in installation.
      • Author - name of the plug-in's developer.
      • Support home page (or "Contact information) - clicking the "Support home page" link will open the page with information about this plug-in. this can be a web-site, forum post or blog. If the "Contact information" field is used instead of the link, it will contain the developer's email address.

  • Hosting Provider API
    • Description

      This document explains in detail the semantics of the function calls you can make using the Hosting Provider API service. This service is limited to access by web hosting providers who have agreed to the required license terms.

  • Host API client (third party, Perl)
  • Host API client (third party, PHP)
  • Drupal plugin (third party)
    • Description

      yadaDROP LLC, a Drupal Development company, has developed a CloudFlare module for Drupal. By using the CloudFlare Drupal Module, you receive:

      • Correct IP address information for comments.
      • Ban/whitelist IP addresses from comment administration.
      • Report spam to CloudFlare (under development).
      • Client administration (planned).
      • Known compatibility with Drupal 6.
      Notes

      This module only provides original IP at the CMS level. If you need original visitor IP at the server level, please install mod_cloudflare

  • WordPress plugin
    • Description

      The CloudFlare WordPress Plugin ensures your WordPress blog is running optimally on the CloudFlare platform.

      CloudFlare has developed a plugin for WordPress. By using the CloudFlare WordPress Plugin, you receive:

      • Correct IP Address information for comments posted to your site
      • Optimization of your server database
      • Better protection as spammers from your WordPress blog get reported to CloudFlare
      Things you need to know

      The main purpose of this plugin is to ensure you have no change to your originating IPs when using CloudFlare. Since CloudFlare acts a reverse proxy, connecting IPs now come from CloudFlare's range. This plugin will ensure you can continue to see the originating IP.

      This plugin can also help to ensure your server database is running optimally. If you are going to run the Database Optimizer associated with this plugin, then run it at a low traffic time. While the database optimizer is running, your site will go into Read Only mode, which means that you or your visitors will not be allowed to post. The optimizer should run quickly. Once the optimizer is done running, you will be able to post to your site again.

      Every time you click the 'spam' button on your blog, this threat information is sent to CloudFlare to ensure you are constantly getting the best site protection.

      We recommend that any user on WordPress and CloudFlare should use this plugin.

      Installation:

      Upload the CloudFlare plugin to your blog, activate it, and you're done!

  • Joomla! plugin
    • Description

      CloudFlare has developed a plugin for Joomla. By using the CloudFlare Joomla Plugin, you receive correct IP Address information for visitors to your site.

      Known compatibility

      Joomla! 2.5, 3.x

      Notes

      If your web server is already running the mod_cloudflare extension, this plugin is not required.

  • IIS Module (third party)
    • Installation

      Create a directory for the HTTP Module. Example:

      C:\> md c:\HttpModules

      Copy the files from the Release build of your target platform (x86 for 32-bit or x64 for 64-bit). Example:

      C:\> xcopy <zip_dir>\x64\Release\* c:\HttpModules

      Copy the Install-XFF-ps1 PowerShell script to the target directory. Example:

      C:\> xcopy <zip_dir>\Install-XFF.ps1 c:\HttpModules

      Change directory to the install path

      C:\> cd c:\HttpModules

      Register the Module with the install script (or via IIS admin).

      C:\HttpModules\> .\Install-XFF.ps1 -cmd install -module_path c:\HttpModules\F5XFFHttpModule.dll

      The module should now be installed in your top level IIS server Module settings as well as each existing application. You can selectively add/remove them from the IIS admin at this point.

      Customization for CloudFlare

      The F5 XFF Http Module supports a configuration file named F5XFFHttpModule.ini. It looks in the same directory as the configured .DLL for a file of the same name as it self with the .INI extension. An example file is included but renamed to F5XFFHttpModule.ini.bak. Once you get rid of the ".bak" extension and restart the application the settings will take effect. In this configuration file, you should override the default header name of X-Forwarded-For to CF-Connecting-IP.