Skip to content

Setting up Cloudflare

tago edited this page Aug 25, 2024 · 20 revisions

How to Install Docker

Cloudflare Tunneling is a service provided by Cloudflare that enables users to securely expose resources within their private networks to the public internet. Unlike traditional methods like port forwarding or reverse proxies, Cloudflare Tunneling establishes a secure connection between the user's network and Cloudflare's global network, effectively extending the reach of the user's services without directly exposing them to potential security risks. First you will need to install Docker on your Linux server.

Update Index and Install Dependencies

  1. Before installing Docker, ensure that your packages are up-to-date again:
    sudo apt update
  2. Install the necessary packages to allow apt to use a repository over HTTPS:
    sudo apt install -y apt-transport-https ca-certificates curl software-properties-common

Download and Install Docker

  1. Add Docker's official GPG key:
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

    Replace "ubuntu" with your Linux distribution. For example, for Debian, it's debian.

  2. Add the Docker repository to your APT sources:
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

    Replace "ubuntu" with your Linux distribution. For example, for Debian, it's debian.

  3. Update the index, and install Docker CE
    sudo apt update
    sudo apt install -y docker-ce

Setting Up Cloudflare Tunneling for Flare

Prepare Domain & Server

  1. Using Flare currently requires you to have an active domain name from a registrar like SquareUp, or Namecheap. If you have not done this yet, read this page
  2. Make sure your nameservers are pointed to Cloudflare.
  3. Have your Linux server online and ready to install Cloudflare Tunnel

Set up Domain Name and Cloudflare Account

  1. Create a free account on Cloudflare and add your domain, Cloudflare will guide you through this process
  2. Wait for DNS propagation (Can take up to 24 hours sometimes)

Create Cloudflare Tunnel

  1. Navigate to the Cloudflare dashboard and access the Zero Trust section
  2. Select "Networks" and then "Tunnels"
  3. Click "Create a tunnel" and choose Cloudflared then next
  4. Name your tunnel and choose the free plan
  5. Proceed through the setup steps, including validating your email address and configuring payment information (the plan is free, payment is for verification)
  6. Select the Docker installation
  7. Copy the connector command and then create a shell script file to run it when needed:
    echo 'docker run -d cloudflare/cloudflared:latest tunnel --no-autoupdate run --token blahblahblah &' | sudo tee Cloudflare.sh

Route Service through the Tunnel

  1. After the tunnel is set up, click on next
  2. Specify the subdomain, and choose your domain
  3. Select HTTP type and url will be the IP address of the WebDAV Linux server and port (it should look like HTTP://10.11.32.121:80).
  4. Save the hostname
  5. Now it's time to finally start setting up Flare on your Linux server!

Clone this wiki locally