In order to be able to server Balancer through the Cloudflare Tunnel, you need a domain and must have access to its DNS Management.
For a complete guide on how to set this up, please visit: Cloudflare Tunnel
-
Log into your Cloudflare account and then navigate to the Zero Trust section. Follow the steps and create your team. Note that even though there seems to be a pay wall, you can always choose the free plan.
-
Once you complete the team creation process and are redirected to the Zero Trust Dashboard, navigate to
Networks/Tunnels
and click on "Add a tunnel". -
Select "Cloudflared" as your connector and click on Next
-
Enter the name of your tunnel (e.g.
balancer
) -
Choose "Docker" as your environment and save the
TUNNEL_TOKEN
securely. Cloudflare gives you a command which includes the token in the following format:docker run cloudflare/cloudflared:latest tunnel --no-autoupdate run --token <TUNNEL_TOKEN>
Since Balancer makes use of Docker Compose, you can just copy the
<TUNNEL_TOKEN>
and place it straight in the Environment Variable Assets Source File -
Now that you have the
TUNNEL_TOKEN
, proceed to generate the environment variable assets and push them to the remote host -
The next step consists in adding the public hostnames for Balancer:
- gui:
Subdomain: balancer Domain: yourdomain.com Path: leave this property blank Service Type: HTTP URL: gui:8090 <service-name:port>
- api:
IMPORTANT: the API must always be exposed under the
Subdomain: balancerapi Domain: yourdomain.com Path: leave this property blank Service Type: HTTP URL: api:5075 <service-name:port>
balancerapi
subdomain as its URL is derived by the GUI at runtime. For example:balancerapi.yourdomain.com
.
- gui: