Skip to content

Dedicated Server (Linux): Set Up a Cloudflare Tunnel for txAdmin

Learn how to set up a Cloudflare Tunnel for txAdmin to improve security

27 November 20263 min read40 Views0 helpful

Introduction

If you want additional security on top of ZAP-Hosting's existing DDoS protection, you can secure your txAdmin instance with a Cloudflare Tunnel. This makes the txAdmin web interface inaccessible directly through your server's public IP address. Instead, you can access it securely through your own domain. Cloudflare filters attacks on the txAdmin port, while you can completely close the local port without losing access.

Requirements

To use a Cloudflare Tunnel on Linux, you need a Linux Dedicated Server, a working txAdmin installation, your txAdmin port, and a domain that is already connected to your Cloudflare account. If your domain is not yet connected to Cloudflare, please follow our Cloudflare setup guide first.

Cloudflare Tunnel works by establishing an encrypted outbound connection from your server to Cloudflare, so no public ports need to be left open for txAdmin.

Cloudflare Setup

Before installing cloudflared on your Linux VPS, create and configure the tunnel directly in your Cloudflare dashboard.

Log in to your Cloudflare account and navigate to the Zero Trust section. There, you can create a new tunnel that will later forward traffic to your txAdmin interface.

Installing Cloudflare Tunnel

Cloudflare provides a small tool called cloudflared. Installing cloudflared on Linux is very easy. First, download and run the installer.

Code
# Cloudflare GPG-Schlüssel hinzufügen
sudo mkdir -p --mode=0755 /usr/share/keyrings
curl -fsSL https://pkg.cloudflare.com/cloudflare-public-v2.gpg | sudo tee /usr/share/keyrings/cloudflare-public-v2.gpg >/dev/null

# Dieses Repo zu deinen apt-Repositories hinzufügen
echo 'deb [signed-by=/usr/share/keyrings/cloudflare-public-v2.gpg] https://pkg.cloudflare.com/cloudflared any main' | sudo tee /etc/apt/sources.list.d/cloudflared.list

# cloudflared installieren
sudo apt-get update && sudo apt-get install cloudflared

After installation, run the provided command:

Code
cloudflared service install eyJhIjoiMj...

Once you have run the commands, your server will connect to Cloudflare through the tunnel. If the setup is successful, the status in the Connectors section changes to Connected—this confirms that the tunnel is active and working.

Configuring the Cloudflare Tunnel

Next, configure the Route Traffic settings. Create a new subdomain entry of your choice. In this example, the subdomain txAdmin is used to access the txAdmin interface later.

Select the domain you want to use, set the service type to HTTP, and enter localhost:port as the URL. Replace port with the port you configured for your txAdmin instance. This example uses port 40500.

Warning: Security tip

For security reasons, we recommend using a different port instead of the default txAdmin port 40120.

Configuring the Linux Firewall

To prevent the port from being accessible outside the tunnel, configure the Linux firewall (iptables) to accept connections to the relevant port only from localhost. Restrict the rule's remote address field to 127.0.0.1. This ensures that all traffic comes from the local system and blocks external access, keeping the service behind cloudflared inaccessible from outside the tunnel.

Code
sudo iptables -A INPUT -p tcp --dport 40500 ! -s 127.0.0.1 -j DROP

This setting blocks all access attempts from outside the machine, ensuring that the service behind cloudflared remains accessible only through the tunnel.

Conclusion

Once the Cloudflare Tunnel is active, your txAdmin interface is accessible only through your own domain, with all requests routed through Cloudflare, where they are filtered and secured.

Direct access to the txAdmin port through the server IP is blocked, completely removing the original attack surface. This keeps txAdmin stable, secure, and reliably accessible—even if someone tries to overload or attack the interface.

If you have any further questions or need help, our support team is here for you every day! 🙂

Free tools

Related tools for servers and developers

View all

FAQ

Frequently asked questions

Your txAdmin web interface is no longer accessible directly through your server's public IP address. Instead, you can access it securely through your own domain. Cloudflare filters attacks on the txAdmin port, while you can completely close the local port.
You need a Linux Dedicated Server, a working txAdmin installation, your txAdmin port, and a domain that is already connected to your Cloudflare account.
It establishes an encrypted outbound connection from your server to Cloudflare, so no public ports need to be left open for txAdmin.

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.