Host multiple domains on a single PC securely using Cloudflare Tunnel setup. Our CloudFlare Support team is ready to assist you. 

Host Multiple Domains on a Single PC Securely

Cloudflare Tunnel connects your local servers or internal applications to Cloudflare’s global network without exposing your system’s public IP address or configuring port forwarding. This operates by running a lightweight service known as Cloudflare on your machine, which establishes encrypted, outbound-only connections to Cloudflare. This tunnel helps you to route traffic safely to web or SSH servers, thereby benefitting from Cloudflare’s built-in protections such as its web application firewall and DDoS mitigation.

Hosting Multiple Domains with Cloudflare Tunnel

Host Multiple Domains on a Single PC Securely

Hosting multiple domains is made possible with a single Cloudflare Tunnel by assigning several public hostnames to one tunnel. This setup can be managed from the Cloudflare Zero Trust dashboard or manually through the config.yml file. When using the dashboard, users can add new hostnames for each domain, and Cloudflare takes care of creating and managing the DNS entries automatically. For those using the configuration file, each domain needs its own ingress rule that maps the hostname to the correct service running on the local machine. This method allows you to operate multiple sites or applications securely under one centralized tunnel. You can also integrate Cloudflare access IDP to control authentication for each domain under the same tunnel, adding an extra layer of identity verification.

Common Problems When Hosting Multiple Domains with Cloudflare Tunnel

Hosting several domains through a single Cloudflare Tunnel can benefit you flexibility and security, on the other hand this can lead to a few challenges if the setup isn’t configured correctly. Majority of the issues occur due to misconfigured ingress rules, DNS records, or improper web server settings. Understanding these causes and their solutions helps maintain a stable and efficient tunnel setup. Here are the common problems encountered while using multiple domains with cloudflare tunnels.

Host multiple domains securely with Cloudflare Tunnel

Talk to us

Chat animation

Tunnel and Ingress Rule Issues 

When Cloudflare Tunnel fails to route traffic properly, the problem often lies in how ingress rules or the tunnel itself are configured.

  • Failed DNS Routing 

Missing or wrong CNAME records can break domain routing. Check the DNS section to confirm records are set correctly.

  • Unstable Tunnel

Frequent log errors or dropped connections may point to network problems or an old client. Restarting helps temporarily, but updating fixes it for good. Cloudflare geofencing can also be used here to limit tunnel access by location, which can help prevent traffic spikes from unwanted regions that may destabilize the tunnel.

  • Incorrect Ingress Setup

Each domain needs its own rule. If a catch-all rule is placed first, it can misroute all traffic.

  • Old Cloudflare Version

An outdated client can cause random disconnects or failed connections. Always keep it updated.

DNS and Network Issues
  1. DNS Delay

New domains might take time to go live. Wait for propagation before testing.

  1. Conflicting Records

Remove old or duplicate CNAME records that could confuse routing.

  1. Proxy Setting Mistakes

Make sure DNS records are proxied through Cloudflare, not set to DNS-only.

Web Server and Host Header Problems
  1. Server Compatibility Issues

Some development servers don’t handle public traffic well. Use a production-ready server for stable performance.

  1. Invalid Host Header

Your web server must accept the hostname Cloudflare sends. Adjust the Host Header setting in your Cloudflare dashboard to match your server.

  1. Header Case Mismatch

Some servers are sensitive to header cases. Adjust server settings if requests fail unexpectedly.

Resource and System Conflicts
  1. One Tunnel per Server

One tunnel can handle many domains. Running multiple tunnels on the same machine can cause errors.

  1. Port Overload

Heavy traffic may use up all ports. If this happens, create separate tunnels for large services.

Hosting Multiple Domains with a Single Cloudflare Tunnel

You can host several domains through a single Cloudflare Tunnel, but doing so correctly depends on precise setup and consistent maintenance. The most reliable way to manage this is through the Cloudflare Zero Trust dashboard, which reduces manual errors and prevents CNAME conflicts. Here’s how to identify and fix the most common issues when running multiple domains under one tunnel.

Running Multiple Tunnels on One Server

Problem
Hosting more than one tunnel on the same machine can lead to overlapping ports and unnecessary management overhead.

Solution
Run a single tunnel and use multiple ingress rules instead. Each domain should have its own hostname entry in the config.yml file.

Example configuration:

tunnel: <tunnel-UUID>
credentials-file: /root/.cloudflared/<tunnel-UUID>.json

ingress:
- hostname: app1.example.com
service: http://localhost:8000
- hostname: app2.anotherdomain.net
service: http://localhost:8001
- service: http_status:404

After saving your changes, restart the cloudflared service to apply them. This setup keeps everything organized and prevents port conflicts.

Inconsistent Domain Routing

Problem
A new domain may fail to resolve if it is not linked to the same Cloudflare account or if DNS settings are incomplete.

Solution
Confirm that all domains belong to the same Cloudflare account before linking them to your tunnel.

• Add the new domain to your Cloudflare account

• Open the Networks section and select Tunnels

• Edit your existing tunnel and add a new Public Hostname

• Assign it to the correct service, such as a local web application

This ensures that every domain routes correctly and consistently across your setup.

CNAME Record Conflicts

Problem
When DNS records are created manually, the cloudflared route dns command may attach the wrong base domain to the CNAME record, leading to routing errors.

Solution
Create each CNAME record manually in the Cloudflare dashboard.

  • Set the CNAME to point to <tunnel-id>.cfargotunnel.com
  • Make sure the proxy option is turned on for that record

This ensures proper routing for each domain without unexpected DNS conflicts.

Managing Tunnels Created from the Command Line

Problem
Older tunnels created through the command-line interface are harder to manage when hosting multiple domains. They often require manual updates, which can become time-consuming and error-prone.

Solution
Move to dashboard-managed tunnels for a more flexible and visual setup.
• Log in to the Cloudflare Zero Trust dashboard

• Go to Networks and select Tunnels

• Choose your existing tunnel and click Configure

• In the Public Hostnames section, click Add a Public Hostname

• Enter your domain name and connect it to the correct local service

This makes management easier, reduces human error, and provides a clear overview of all connected domains.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

Hosting multiple domains on a single PC through Cloudflare Tunnel is simple and secure when configured correctly. With proper DNS and ingress settings, you can manage all domains smoothly using the Cloudflare Zero Trust dashboard. Start hosting multiple domains on a single PC today for a safer and more efficient setup.