Skip to main content

Cloudflare Tunnels

This guide will show you how to use Cloudflare Tunnels. With Cloudflare Tunnels you can use a domain with an SSL certificate for your website.

Requirements

Getting started

1. Login to Cloudflare

Navigate to the Cloudflare Zero Trust Dashboard (If it asks you to select a plan to pay for, close that tab and open a new one. All of the things we need are available in the Free plan) and login with your Cloudflare account.
Then, on the sidebar, click on Zero Trust, open the dropdown menu under the Networks section, and select Tunnels.

2. Create a Tunnel

  1. Click on Create a Tunnel

  2. Choose Select Cloudflared

  3. Enter a name for your tunnel (e.g.: "My Website Tunnel" or "AFK Hosting Tunnel")

  4. Click Save Tunnel

  5. Select the Windows option and copy the command that is shown. It should look something like this:

    cloudflared.exe service install ey...
  6. Open your server's Startup tab and paste the command into the Cloudflared Tunnel Token field, then REMOVE THE cloudflared.exe service install PART so it looks like this:

    eyabOigTzHBvW0UU82RWenDe6UfGfwE2nCIS3zJOJi4vjwQnEvcO6p2uRNuv1T87huOibpkhLgqpzZhUDcEBCyXKuwvpbv7UsORcIOF1EC6Vsotq3uufLM1QyJfFirI3MPqTzkcbD8XeNTBgQfwZrMpRyZgFYcbmTanTFBf1CyieTuxR1V7QyUh8
  7. Toggle the Enable Cloudflare Tunnel switch to ON

  8. Restart your server.

  9. Once your server has restarted, you should now see a new item in the Connectors section of the Tunnels dashboard. Once you see this, click the Next button.

  10. You will now be taken to the Public Hostname tab. Here you can create a hostname for your website.

    • Subdomain: This is the subdomain you want to use for your website. For example, if you want to use store.example.com then you would enter store here.

    • Domain: The domain connected to your Cloudflare account. Use the domain you want to use for your website.

    • Path: Leave empty.

    • Service Type: Select HTTP

    • URL: Go to the Console tab of your server, copy the Address field, and paste it here. For example, if your address is us1.afkhosting.win:39600, then you would enter us1.afkhosting.win:39600 here.

    Click the Complete Setup button to create the hostname. You can now visit your website by going to the subdomain you just created (e.g., store.example.com) instead of the Address in the Console tab.