Deploy Cloudflare tunnel on RISC-V PC

Cloudflare Tunnel is an online service that allows users to publish a local website on the Internet without requiring a fixed IP address for their own server.

If you’re using a RISC-V PC development board and want to deploy a website directly from it, making the website publicly accessible, you may have noticed the lack of documentation for installing Cloudflare Tunnel library on RISC-V architecture. This page offers a solution for setting up Cloudflare Tunnel on a RISC-V PC.

🧩 Operating Environment

Solution 1: Linux running on RISC-V PC
Solution 2: Linux running on x86/x64 and RISC-V PCs

⚠️ Issue

Lack of documentation to install Cloudflare tunnel library on RISC-V architecture.

Supported architecture on Cloudflare tunnel

Here are 2 solutions to install Cloudflare tunnel library on RISC-V architecture. If you’re more comfortable developing your own Cloudflare tunnel library for the RISC-V architecture, we recommend proceeding with the second solution.

  1. The first solution is the easiest solution. Cloudflare tunnel library has been compiled by the developer following the procedures mentioned in the second solution. Hence, you would just need to download the file to the specific directory and then extract it.
  2. The second solution is a bit more complicated. You would need to build your own RISC-V architecture Cloudflare tunnel library on an X86 or X64 Linux PC. Then, you would need to transfer the file to the specific directory on RISC-V Linux PC and then extract it.

✔️ Solution 1

On your RISC-V Linux PC, run the following commands in the terminal.

Go to tmp directory

Shell (RISC-V Linux)
cd tmp

Download cloudflare.zip by pasting the following command in the terminal

Shell (RISC-V Linux)
wget --no-check-certificate 'https://drive.google.com/uc?export=download&id=17qIE2Tm7NJQnHPPoOomRTjRsiU-jBSFb' -O cloudflare.zip

Decompress cloudflare.zip

Shell (RISC-V Linux)
unzip cloudflare.zip

Move cloudflared file to ‘/usr/local/bin/cloudflared’
Remove cloudflare.zip and the useless folder

Shell (RISC-V Linux)
mv /tmp/cloudflared/cloudflared /usr/local/bin/cloudflared
rm cloudflare.zip
rm -r cloudflared

Set execute permission to ‘cloudflared’ file

Shell (RISC-V Linux)
chmod +x /usr/local/bin/cloudflared

Check if Cloudflared can be run in the terminal

Shell (RISC-V Linux)
which cloudflared

Log in to Cloudflare on your browser

Click ‘Copy’ as shown in the figure below to copy the command with the token key

Copied Cloudflare tunnel token key

Paste it in RISC-V Linux’ PC’s terminal and press enter key to run the command

Click Tunnels on the left menu

Cloudflare tunnel menu

Check if the connection status of your Cloudflare tunnel is HEALTHY

Cloudflare TunneL Status

Solution 1 Done

Watch this video on YouTube for a step-by-step guide.

✔️ Solution 2

Part 1: run the following commands in the terminal on your X86 or X64 Linux PC.

Go to Downloads directory and update Linux package

Shell (X86 or X64 Linux)
cd
Shell (X86 or X64 Linux)
cd Downloads
Shell (X86 or X64 Linux)
sudo apt-get update

Download and install Go package by pasting the following command in the terminal

Shell (X86 or X64 Linux)
wget https://go.dev/dl/go1.24.7.linux-amd64.tar.gz
Shell (X86 or X64 Linux)
sudo tar -C /usr/local -xzf go1.24.7.linux-amd64.tar.gz
Shell (X86 or X64 Linux)
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
Shell (X86 or X64 Linux)
source ~/.profile

Check if Go package is properly installed

Shell (X86 or X64 Linux)
go version

Install git package

Shell (X86 or X64 Linux)
sudo apt-get install git

Download cloudflared source code by pasting the following command in the terminal

Shell (X86 or X64 Linux)
git clone https://github.com/cloudflare/cloudflared.git
Shell (X86 or X64 Linux)
cd cloudflared

Run these commands in the terminal

Shell (X86 or X64 Linux)
GOOS=linux GOARCH=riscv64 go build -o /tmp/cloudflared ./cmd/cloudflared

Check whether Cloudflare build architecture is RISC-V

Shell (X86 or X64 Linux)
cd ..
Shell (X86 or X64 Linux)
cd ..
cd tmp
file cloudflared

Make sure that the build architecture is RISC-V

cloudflare build info

You need to transfer this file ‘cloudflare from /tmp on X86 or X64 PC to /tmp on RISC-V PC manually.

Part 2: Run the following commands in the terminal on your RISC-V Linux PC

Go to tmp directory and check if cloudflared file exists

Shell (RISC-V Linux)
cd ..
cd tmp
ls
RISC-V tmp folder

Move ‘cloudflared’ file to ‘/usr/local/bin/cloudflared’

Shell (RISC-V Linux)
mv /tmp/cloudflared /usr/local/bin/cloudflared

Set execute permission to ‘cloudflared’ file

Shell (RISC-V Linux)
chmod +x /usr/local/bin/cloudflared

Check if Cloudflared can be run in the terminal

Shell (RISC-V Linux)
which cloudflared

Log in to Cloudflare on your browser. Click ‘Copy’ as shown in the figure below to copy the command with the token key.

Copied Cloudflare tunnel token key

Paste it in RISC-V Linux’ PC’s terminal and press the enter key to run the command.

Click Tunnels on the left menu

Cloudflare tunnel menu

Check if the connection status of your Cloudflare tunnel is HEALTHY

Cloudflare TunneL Status

Solution 2 Done


If there are any inquiries, please contact us through our Facebook page.