-
Notifications
You must be signed in to change notification settings - Fork 257
CloudFlare Tunnel
Cloudflare Tunnel provides a secure way to expose your internal applications to the internet without needing to open ports on your firewall or configure a VPN. It acts as a secure gateway between your internal network and Cloudflare, ensuring that traffic to your applications is protected and can be easily managed. This guide will walk you through the process of setting up a Cloudflare Tunnel, enabling it, and protecting your applications with additional security measures.
Cloudflare Tunnel, formerly known as Argo Tunnel, works by establishing an encrypted connection between your internal network and the Cloudflare network. Instead of exposing your IP address directly to the internet, you route your application traffic through a secure tunnel that ends at a Cloudflare data center. Here’s how it works:
- Secure Tunnel Creation: The Cloudflare Tunnel agent (a lightweight daemon) is installed on your server. This agent creates a secure connection to Cloudflare's edge servers, effectively acting as a tunnel.
-
Traffic Management: All incoming traffic to your application's domain (e.g.,
app.yourdomain.com
) is directed through Cloudflare's network. Cloudflare's edge servers route the traffic through the tunnel to your internal application, ensuring encryption and protection. - No Open Ports Required: Since the traffic is routed through Cloudflare, you don't need to open any ports on your firewall. This reduces the risk of attacks and simplifies network security.
- Access Control: With Cloudflare’s Zero Trust model, you can enforce authentication and authorization policies, ensuring that only authorized users can access your internal applications.
To use Cloudflare Tunnel with PlexGuide, follow these steps:
- Access your PlexGuide server: Open your server’s terminal or SSH into it if you are managing it remotely.
-
Navigate to the PlexGuide menu: In your terminal, run the PlexGuide script to access the main menu.
plexguide
- Select Cloudflare Tunnel from the menu: Follow the on-screen instructions to install the Cloudflare Tunnel agent. PlexGuide automates the setup process, making it easier to integrate Cloudflare Tunnel with your server.
- Log in to your Cloudflare account: Visit Cloudflare and sign in with your credentials.
- Create a new tunnel: Navigate to Zero Trust > Access > Tunnels and click on Create a Tunnel.
- Name your tunnel: Give your tunnel a descriptive name and follow the instructions provided by Cloudflare.
- Download the configuration file: After creating the tunnel, download the Cloudflare Tunnel configuration file. This file will be used to establish a secure connection between your server and Cloudflare.
- Go to the Cloudflare Zero Trust dashboard and access the tunnel configuration settings.
-
Add DNS records: If you haven't done so already, add DNS records for your subdomains (e.g.,
app.yourdomain.com
). This will direct traffic from these subdomains through the Cloudflare Tunnel. - Apply the settings: Use the Cloudflare interface to apply the settings. Cloudflare will handle routing traffic through the tunnel securely to your internal applications.
Cloudflare Tunnel can route traffic to multiple internal applications. This is managed through the Cloudflare interface, where you can define rules for each subdomain.
-
Define Ingress Rules: In the Cloudflare interface, specify the internal application endpoints. For example:
-
plex.yourdomain.com
->http://localhost:32400
-
sonarr.yourdomain.com
->http://localhost:8989
-
radarr.yourdomain.com
->http://localhost:7878
-
-
Set Up Subdomains: Ensure that the subdomains are correctly set up to point to their respective applications. Cloudflare will handle the routing and encryption.
Cloudflare Tunnel integrates with Cloudflare Access to provide an additional layer of security by requiring sign-in before users can access your internal applications.
- Go to Cloudflare Zero Trust: Navigate to Access > Applications in the Cloudflare dashboard.
- Add a new application: Click on Create Access Application.
-
Set up your application:
- Application Name: Give your application a meaningful name.
-
Application Domain: Enter the domain (e.g.,
plex.yourdomain.com
). - Session Duration: Define how long users can stay logged in without re-authentication.
- Configure Access Policies: Define who can access your application. You can require users to sign in with Google, GitHub, or other identity providers.
- Go to Access Policies: Under the application settings, click Add a policy.
-
Set up rules:
- Action: Select Allow.
- Include: Choose the identity providers (e.g., email domain, specific users) allowed access.
- Exclude: Optionally, define conditions for denying access.
- Save the policy and apply it to your application.
With these steps, only authenticated users will be able to access your internal applications through the Cloudflare Tunnel.
Using Cloudflare Tunnel with PlexGuide enhances the security and accessibility of your internal applications. By routing traffic through Cloudflare, you protect your server from direct exposure to the internet and gain the flexibility to implement advanced security measures, such as sign-in enforcement. Follow this guide to set up and configure your Cloudflare Tunnel, ensuring that your media server and other applications remain secure and easily accessible.
Home - https://plexguide.com