Blog

Self-Hosting a Secure and Flexible Web Hosting Environment Using HAProxy, pfSense, Let's Encrypt, and Cloudflare

Posted on April 3, 2025 by John Networking Computer Security Web Development

In this article, I'll walk you through a comprehensive setup for self-hosting web applications. This configuration is ideal for both homelabs and small production environments, enabling you to host multiple websites on a single IP address and port. We'll focus on security, flexibility, and centralized management.

Using pfSense as our base operating system, router, and firewall, we'll leverage the ACME protocol for automated SSL certificate management, HAProxy for reverse proxying, and Cloudflare for DNS and CDN services.

I'll explain the role of each component and guide you through every step of the process-including how to avoid some common gotchas. By the end, you'll have a secure and efficient setup that hosts multiple services on a single public IP and port.

Affiliated Organizations

Copyright ©2020-2025 John H. Ring IV. All rights reserved.
The content on this website is my own and does not necessarily reflect the views of my employer or any other party.