Install Cloudflare Tunnel on QNAP for Internal Network Penetration
Before You Start
Assuming you already have a QNAP and have registered for CF tunnel, and can find the CF tunnel location.
Install Cloudflare Tunnel Using Docker
Because QNAP's system is... let's say not ideal, don't expect a native CF tunnel connector for this system. But fortunately there's Docker, so we'll use Docker for installation.
Find Docker in the CF tunnel interface, then copy the command:

Before proceeding to the next step, wait - we need to modify the command:
docker run -d --network host \
docker.996.ninja/cloudflare/cloudflared:latest tunnel --no-autoupdate run --token <token>
- Change the token to yours
--networkuses host network mode, so the container can directly use the host's network. CF tunnel in the container requesting localhost won't reach the host's services otherwise.
Create Your Public Hostname in CF Tunnel


Note that I'm using port 5000 here because my QNAP doesn't use HTTPS. I also recommend not setting up HTTPS because Cloudflare will handle that for us.
If you want to disable it, you can uncheck it in QNAP:

After saving in CF tunnel, open your domain in the browser. You can see the service is now exposed to the public internet. Done!
