How to use Cloudflare Zero Trust tunnel with YunoHost

This guide will help you with finding the port, setting up correct firewall rules and adding it to cloudflare. I’m going to skip important Cloudflare steps as this is purely aimed add users who already now how to use Cloudflare tunnels but are stuck at the YunoHost part.

Important:

  • If Cloudflared (your tunnel), is running on the same machine as YunoHost, skip part 2 and 3. If Cloudflared is running in the same network on a different machine/host, then step 2 is mandatory.

Step 1 (find the port of the application):

  • Go to the YunoHost admin page
  • Click on Tools < services: look for the application that you want to host through the tunnel, click on the application.
  • Now on this new page, you should see “Journalctl (logs)”, in the logs it will tell you which port it is.

Step 2 (Open the port with the firewall)

  • Go back to the YunoHost admin page
  • Click on Tools < Firewall
  • Scroll down towards “Operations”
  • Fill in the port and click save, after a couple of seconds you will see that the port is added and open.

Step 3 (test it)

Step 4 (Cloudflare)

  • I’m skipping many steps here as explained in the beginning.
  • On the Public Hostname Page of the Cloudflare tunnel, add the following under service:
    Type: HTTP
    URL: IpOfYunoHost:PortOfApplication

Note: If you have any questions, feel free to ask and I will try my best to help you.

hello,

i’m quite stuck here with cloudflare tunnel and yunohost. i use cloudflare tunnel to serve many apps on my proxmox server but it looks impossible to make it work with yunohost.

How do you setup domain name on yunohost to make this work ? or do you have to setup a cloudflare domain name or subdomain ?

it seems that when you add hostname to an app inside yunohost, it directly requests a certificate witch seems useless with tunnels.

Moreover some apps configurations need a domain to setup their own web interface (vikunja, wallabag, …) so i you dont setup the hostname correctly you dont have access to anything

could you explain a little more detailed procedure how to setup yunohost domains ? do we have to set .local domains ?