Cloudflare – DNS Management and Secure Reverse Proxy for My Infrastructure
Overview
To provide a secure, performant, and globally available entry point for all my self-hosted services, I configured Cloudflare as both my DNS provider and reverse proxy. This setup allows me to expose internal services (like Nextcloud, RustDesk, Grafana, or n8n) through public domains, without directly exposing my home IP or ports.
Cloudflare acts as a powerful intermediary — handling SSL/TLS encryption, caching, DDoS protection, and intelligent routing — while my backend services remain safely behind the proxy.
Motivation
Hosting projects at home using Proxmox and Docker is convenient but introduces security and accessibility challenges. I needed a way to:
- Avoid exposing my home IP address.
- Manage SSL certificates automatically.
- Access all my services using clean, memorable domains.
- Increase uptime and load performance for users outside my LAN.
Cloudflare solved all of these problems elegantly, while also providing a clean dashboard and API integration for automation.

Architecture
Key Components:
- Cloudflare DNS: Manages my public domain
portfolio.black-crab.ccand all subdomains. - Cloudflare Proxy (Orange Cloud): Masks my origin IP and routes traffic securely through Cloudflare’s global edge network.
- Cloudflare Tunnel (cloudflared): Securely connects my internal services to Cloudflare without opening ports on my router.
Implementation Steps
1. Login to my Cloudflare account

2. Domain (Back-Crab.cc) → Access → Launch Zero Trust

3. Networks → Tunnels → Create a tunnel → Select Cloudflared

4. Choose a name, in my case portfolio → Next → I always choose docker, i like docker..

4. Create a docker-compose.yaml for re deployment if it will need!
services:
cloudflared:
container_name: Radio-Tunnel
image: cloudflare/cloudflared:latest
command: tunnel --no-autoupdate run --token
restart: unless-stopped
networks:
default:
external: true
name: Apps-Network
5. Edit the application routes configuring the Subdomain and the internal URL


After running the docker-compose.yaml the tunnel is up and running without the need to perform port forwarding or exposing my public ip.
docker-comose up -d

6. Testing and Validation
- Access services via browser at their respective subdomains.
- Check SSL certificate issued by Cloudflare.
- Validate origin IP masking via:
curl -v https://nextcloud.portfolio.black-crab.cc
it should show Cloudflare edge IPs instead of your home IP.
Conclusion
Using Cloudflare Tunnels to expose self-hosted applications has proven extremely effective and practical. It allows me to make internal services like Nextcloud, Grafana, n8n, or RustDesk available to the internet without opening ports or exposing my home IP, greatly reducing security risks.
The setup provides automatic SSL/TLS encryption, DDoS protection, and intelligent global routing, ensuring that applications are secure, fast, and reliable for users outside my LAN. With centralized management via the Cloudflare dashboard and API, adding or modifying services becomes straightforward and scalable.
Overall, Cloudflare Tunnels transform self-hosted apps into professionally accessible services, combining convenience, security, and performance, while preserving full control over my local infrastructure.