A guide on how to use Cloudflare Tunnels with Coolify.
For more details about CF Tunnels, please visit this page.
Setup Tunnels on Cloudflare
https://one.dash.cloudflare.com/
.
Networks
-> Tunnels
-> Create a Tunnel
Cloudflared
Cloudflare Tunnel Token
from any of the commands.
eyJ...
.Route Tunnel
tab, add the following tunnels:Setup Tunnels on Coolify
IP Address
- it will be reconfigured later on.
Configure
in the Cloudflare Tunnels
section.
Cloudflare Tunnel Token
from the previous step and set the SSH Domain
to the domain you set in the previous step.
Coolify Proxy
and set it to None
, it is not needed in this
case.Public Hostname
tab.Public Hostname
.
Domains
settings. - Set Port Mappings
to the same port that you set in the Public Hostname
settings.
80
inside the container and I’m mapping it to the port 8888
on the host. So,
I need to set the Port Mappings
to 8888:80
.
Coolify's Proxy
to route the traffic to the correct
resource.Public Hostname
tab.Public Hostname
.
Networks -> Tunnels
and click on your tunnel name. From the sidebar copy the Tunnel ID
.
DNS
settings and add a new CNAME
record with the following settings:
Name
: *
Target
: <Tunnel ID>.cfargotunnel.com
TTL
: Auto
Domains
to any subdomain of the wildcard domain you set in the previous step.
http://
in the Domains
settings. Cloudflare will take care of the https
part.
For this you need to set SSL/TLS
to Full
in the SSL/TLS
menu on Cloudflare.
SSH (port:22 by default)
) on your firewall.
Coolify Proxy
or wildcard setup with Coolify Proxy
to expose your self-hosted Coolify instance to the internet.
With the wildcard
setup, you have nothing to do.
With the one domain
setup, you need a bit more setup with Coolify to make it work.
Let’s say you configured the following Public Hostnames
in Cloudflare:
app.coolify.io
mapped to localhost:8000
realtime.coolify.io
mapped to localhost:6001
.env
file, located in /data/coolify/source
folder.
If you have a firewall, you also need to allow the following ports.
https://app.coolify.io
.https://app.coolify.io/realtime
. On the other tab (opened in point 2), you should see a notification about the test event.