BitMindAI

Open menu
APIs

How to Host Website using Cloudflare Tunnel?

01 May 2025 | MrLwitwma

What is Cloudflare Tunnel?

Cloudflare Tunnel securely connects your local server to the internet through Cloudflare's network without exposing your public IP. Lets say you have a local website running on your deice so to make the website live you would use your public IP address so that users can use the system you build. You would need to configure your domain to point to that IP address, using Cloudlfare Tunnel your IP address will be kept safe.

Cloudflare Tunnel will keep my IP safe How?

Cloudflare Tunnel works as a type of reverse proxy that securely routes traffic from Cloudflare’s edge to your local server. So its like if a user opens your website(example.com) and ask for data from the site(example.com) the request will be routed to Cloudflare then Cloudflare will route the request to your local website(http://localhost:5000). Then your local server will respond the data to cloudflare then the cloudflare will give the data to the user. You might think that this process will take a lot of time but this process happens in milliseconds so it does not feel like it is taking a lot of time.

How to install cloudflare Tunnel? (Windows)

To use cloudflare tunnel you will have to download cloudflared on you PC. To download cloudflared paste the following code on your command prompt.

    This code is going to be for the windows user.
  1. Open Command Prompt as administrator

  2. Download cloudflared.exe
  3. curl -L -o cloudflared.exe https://developers.cloudflare.com/cloudflare-one/static/documentation/connections/connect-apps/install-and-setup/installation-links/windows/cloudflared.exe

  4. Move cloudflared.exe to a system PATH directory
  5. move cloudflared.exe C:\Windows\System32\

  6. Verify installation
  7. cloudflared --version

How to install cloudflare Tunnel? (Linux)

To use cloudflare tunnel you will have to download cloudflared on you PC. To download cloudflared paste the following code on your command prompt.

    This code is going to be for the Linux user.

  1. Download cloudflared.exe
  2. # Debian/Ubuntu
    wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb

  3. Install the package:
  4. sudo dpkg -i cloudflared-linux-amd64.deb

  5. Verify installation
  6. cloudflared --version

How to start hosting website?

To host your local website lets say running on the url "http://127.0.0:5000"
You would need to open your command prompt then type the following command.

cloudflared tunnel --url 127.0.0:5000
Then find url in a box like this:
2025-05-01T18:01:00Z INF +--------------------------------------------------------------------------------------------+ 2025-05-01T18:01:00Z INF | Your quick Tunnel has been created! Visit it at (it may take some time to be reachable): | 2025-05-01T18:01:00Z INF | https://others-across-filme-irc.trycloudflare.com | 2025-05-01T18:01:00Z INF +--------------------------------------------------------------------------------------------+
On opening the URL you will see your local site online and anyone with the internet can use your website and all the request will be sent to your local server.

Warnings

There is not much warning just that you will have to keep your PC running for the website to run without it being closed. And ya you will need your device to be connected to the internet to keep it running or else the data will not be sent and received.