Cloudflare Tunnel in CasaOS
Setting Up Cloudflare Tunnel in CasaOS
Step 1: Install the Cloudflared App
- Access the App Store: In your CasaOS dashboard, navigate to the App Store.
- Search for Cloudflared: Use the search bar to find the Cloudflared app.
- Install the App: Click on the app and follow the prompts to install it.
Step 2: Create a Tunnel in Cloudflare
-
Log in to Cloudflare: Go to Cloudflare and log in to your account.
-
Navigate to Zero Trust: Click on Zero Trust in the dashboard.
-
Access Tunnels: In the sidebar, click on Tunnels.
-
Create a Tunnel: Click on Create a Tunnel.
-
Configure Tunnel:
- Name: Give your tunnel a name (e.g.,
home-tunnel
). - Hostname: Specify the subdomain you want to use (e.g.,
home.yourdomain.com
). - Service: Enter the local service URL, such as
http://192.168.1.x:PORT
.
- Name: Give your tunnel a name (e.g.,
-
Save the Tunnel: After configuring, click Save.
-
Obtain Tunnel Token: Scroll down to the Tunnel Connector section and copy the Tunnel Token.([Pi My Life Up][1], [IceWhale Community Forum][2])
Step 3: Configure Cloudflared in CasaOS
- Open Cloudflared App: In your CasaOS dashboard, go to Installed Apps and click on the Cloudflared app.
- Enter Tunnel Token: Paste the Tunnel Token you copied earlier into the provided field.
- Save Configuration: Click Save. The button will change to Start once saved.([IceWhale Community Forum][2])
Step 4: Start the Tunnel
- Start Tunnel: Click the Start button. The status will change to Healthy once the tunnel is active.
Verify the Setup
- Access the Service: Open a browser and navigate to the hostname you configured (e.g.,
home.yourdomain.com
). You should see your local service. - Check Tunnel Status: In the Cloudflare dashboard, under Tunnels, ensure the tunnel status is Healthy.
Optional: Enhance Security
- SSL/TLS Settings: In Cloudflare, go to the SSL/TLS settings and set the SSL mode to Full (Strict) for secure connections.
- Firewall Rules: Configure your local firewall to accept connections only from Cloudflare's IP ranges.
This method leverages Cloudflare's Zero Trust platform, providing a secure and straightforward way to expose your local services without the need for complex configurations.