Cloudflare Tunnel + PM2
Basic setup when you want panel access on a public domain without opening panel port directly to internet.
Basic public-access setup after Quickstart. Apply only if you need domain exposure through Cloudflare.
Install cloudflared
# see official Cloudflare install docs for your distro
cloudflared --version
Create tunnel
cloudflared tunnel login
cloudflared tunnel create cpanel-rocky
cloudflared tunnel route dns cpanel-rocky panel.example.com
Config
tunnel: cpanel-rocky
credentials-file: /home/user/.cloudflared/xxxx.json
ingress:
- hostname: panel.example.com
service: http://127.0.0.1:3000
- service: http_status:404
Run with PM2
pm2 start "cloudflared tunnel run cpanel-rocky" --name cpanel-tunnel
pm2 save
After enabling tunnel, set
APP_URL in panel `.env` to the HTTPS tunnel hostname.If login/callbacks fail after tunnel changes, first verify `APP_URL`, then temporarily disable tunnel and test locally on direct panel URL.
