keepcalculator

06 Numbers and Powers

Tailscale vs Cloudflare Tunnel for Self-Hosted Remote Access

Card No. 06·30526 · Updated · Standard formula, shown below

To access self-hosted services remotely, both Tailscale and Cloudflare Tunnel work well, but they solve the problem differently: Tailscale creates a private peer-to-peer VPN between your devices, while Cloudflare Tunnel exposes specific services through Cloudflare’s edge network via a public URL. Choose Tailscale for private, secure access to many services with minimal setup, and choose Cloudflare Tunnel when you need to share services publicly or want built-in DDoS protection and access policies.

Background: The Problem of Remote Access

Self-hosting means running services like Nextcloud, Jellyfin, Home Assistant, or a personal wiki on hardware you control. When you’re away from home, accessing those services traditionally required either port forwarding on your router (which exposes services to the internet and invites scanning) or a VPN server (which requires configuring clients and managing certificates). Both approaches have drawbacks: port forwarding creates security risks, and traditional VPNs can be complex to set up and maintain.

Tailscale and Cloudflare Tunnel are modern alternatives that avoid opening inbound ports. They use outbound connections from your home network to a coordination service, so no ports need to be forwarded. This makes them safer and often easier to configure than older methods.

How Tailscale Works

Tailscale is a mesh VPN built on the WireGuard protocol. You install the Tailscale client on each device you want to connect—your home server, laptop, phone, etc. Each device gets a stable, unique IP address (like 100.x.y.z) that only your devices can reach. Traffic is encrypted end-to-end, and when possible, devices connect directly to each other (peer-to-peer) using NAT traversal. If direct connection fails, Tailscale relays traffic through its DERP servers (which are only used for encrypted relay, not for decryption).

To access a self-hosted service, you simply use the Tailscale IP of your server plus the service’s port. For example, if your server’s Tailscale IP is 100.101.102.103 and you run Home Assistant on port 8123, you’d visit http://100.101.102.103:8123. You can also use MagicDNS to give your server a name like my-server and access it at http://my-server:8123.

Key features:

  • Works on Windows, macOS, Linux, iOS, Android, and many NAS devices
  • No port forwarding needed
  • Access is limited to devices you authorize (via your Tailscale account)
  • Free tier allows up to 100 devices and 3 users

How Cloudflare Tunnel Works

Cloudflare Tunnel (formerly Argo Tunnel) runs a lightweight daemon called cloudflared on your home server. This daemon establishes an outbound connection to Cloudflare’s edge network. You then configure a hostname (like nextcloud.example.com) in your Cloudflare dashboard to route traffic to that tunnel. When someone visits that hostname, Cloudflare forwards the request through the tunnel to your server.

Unlike Tailscale, Cloudflare Tunnel is designed to expose services to the public internet. That means anyone with the URL can access the service unless you add extra protection. Cloudflare offers Access (a zero-trust authentication layer) that can require users to log in with an email, Google account, or other identity provider before reaching your service. You can also set up rules based on IP, country, or device posture.

Key features:

  • No port forwarding needed
  • Provides a public HTTPS URL automatically (Cloudflare issues SSL certificates)
  • Built-in DDoS protection and caching (for static content)
  • Free tier includes up to 50 tunnels and 500 MB of logs
  • Works well for sharing services with others (e.g., giving a friend access to a photo gallery)

Choosing Between Tailscale and Cloudflare Tunnel

The choice depends on your primary use case. If you are the only user (or a small group) and want to access all your self-hosted services securely from your own devices, Tailscale is usually simpler. You install it once, and all your services are accessible by IP or hostname without any per-service configuration. It also works for non-HTTP services like SSH, SMB file sharing, or game servers, because it operates at the network layer.

If you need to share a service with people who don’t have Tailscale installed, or you want a public-facing website with a custom domain, Cloudflare Tunnel is the better fit. It also gives you a layer of protection against DDoS attacks and lets you use Cloudflare’s Access policies to restrict who can reach your service.

You can also combine both: use Tailscale for your own private access, and Cloudflare Tunnel only for the one service you want to share publicly. That way you get the best of both worlds.

Common Problems and How to Avoid Them

  • Tailscale not connecting: Ensure the Tailscale service is running on your server, and that your server is online. Check if you’ve logged into the same Tailscale account on all devices. If you’re behind a strict firewall, Tailscale will automatically fall back to DERP relay, so connectivity should still work.
  • Cloudflare Tunnel not routing: Verify that the cloudflared process is running and connected. Check the Cloudflare dashboard under Zero Trust → Networks → Tunnels to see if the tunnel is healthy. Also ensure your DNS record points to the tunnel (CNAME with the tunnel target).
  • SSL errors: With Cloudflare Tunnel, SSL is handled automatically. With Tailscale, you may need to use HTTP (not HTTPS) unless you set up your own certificates. For local testing, you can use http://[tailscale-ip]:port.
  • Slow speeds: Tailscale peer-to-peer connections are usually fast, but if you’re relaying through DERP, speeds may be lower. Cloudflare Tunnel adds a hop through Cloudflare’s network, which can add latency but is usually acceptable.
  • Access control: If you expose a service via Cloudflare Tunnel without Access, it’s public. Always add at least a basic Access policy if you don’t want strangers using your service.

Costs and Limits

Both services offer free tiers that are generous for personal use. Tailscale’s free plan includes up to 100 devices and 3 users, which is plenty for a home lab. Cloudflare Tunnel’s free plan allows up to 50 tunnels and 500 MB of logs per month, which is enough for most self-hosted setups. If you need more (e.g., more users, longer logs, or advanced features), both offer paid plans, but most individuals never need them.

One cost to consider is that Cloudflare Tunnel requires you to have a domain name (you can use a free subdomain from Cloudflare, but it’s less convenient). Tailscale doesn’t require a domain.

Security Considerations

Both tools are designed to be secure, but you still need to follow best practices:

  • Keep your self-hosted services updated to patch vulnerabilities.
  • Use strong passwords or, better, enable single sign-on (SSO) where possible.
  • For Tailscale, enable two-factor authentication on your Tailscale account and consider using ACLs to restrict access between devices.
  • For Cloudflare Tunnel, always use Access policies to protect any service that contains sensitive data. Even if you want public access, consider adding rate limiting or bot protection.
  • Never expose a service that has known unpatched vulnerabilities, regardless of the tunnel method.

A common misconception is that Cloudflare Tunnel is more secure because it hides your home IP address. While that’s true, Tailscale also hides your IP because you’re not opening any ports. Both are safe when configured correctly.

Alternatives to Consider

Other options exist for remote access to self-hosted services:

  • ZeroTier: Similar to Tailscale, a mesh VPN with a free tier. It’s a bit more technical to set up.
  • WireGuard directly: If you have a static IP or a dynamic DNS service, you can set up your own WireGuard server. This gives you full control but requires more configuration.
  • OpenVPN: A traditional VPN that’s widely supported but can be slower and more complex to configure.
  • Reverse proxies like Nginx Proxy Manager or Caddy: These can be combined with a tunnel to add authentication, but they don’t solve the NAT traversal problem by themselves.

For most people, Tailscale or Cloudflare Tunnel are the easiest and most effective solutions. Your choice should be based on whether you need public sharing or private access.

Frequently Asked Questions

Can I use Tailscale and Cloudflare Tunnel together?

Yes, you can run both at the same time. For example, use Tailscale for your own private access to all services, and Cloudflare Tunnel only for a specific service you want to share publicly. Just make sure the two don’t conflict (e.g., don’t expose the same service through both if you don’t want public access).

Do I need a domain name for Cloudflare Tunnel?

Yes, Cloudflare Tunnel requires a domain name that you add to your Cloudflare account. You can use a free subdomain from Cloudflare (e.g., your-name.trycloudflare.com) for testing, but it’s not stable for production. For a permanent setup, you need a domain you control.

Which is faster: Tailscale or Cloudflare Tunnel?

Tailscale is generally faster because it creates direct peer-to-peer connections when possible, avoiding relay servers. Cloudflare Tunnel always routes traffic through Cloudflare’s edge, which adds a small amount of latency. However, for most web applications, the difference is negligible.

Can I expose SSH through Tailscale or Cloudflare Tunnel?

Yes. Tailscale works at the network layer, so you can SSH to your server using its Tailscale IP. Cloudflare Tunnel can also forward SSH traffic, but you need to configure it properly (using cloudflared access or a TCP tunnel). It’s more complex than Tailscale for SSH.

What happens if my home internet goes down?

Both services depend on your home internet connection. If your internet is down, you can’t access your self-hosted services through either method. You could set up a backup connection (e.g., a 4G LTE failover) or run services on a cloud VPS as a backup, but that’s beyond the scope of these tools.

Are there any security risks with using these tunnels?

The main risk is misconfiguration. If you expose a service publicly via Cloudflare Tunnel without access controls, it’s open to the internet. With Tailscale, the risk is lower because only devices you authorize can connect. Always use strong authentication and keep your software updated.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →