
How to Install HAProxy and Traefik on a Proxmox VM with CentOS 9, 10, or 11
HAProxy is a high-performance TCP/HTTP load balancer widely used for distributing traffic across multiple backend servers. Traefik is a modern reverse proxy and load balancer optimized for dynamic environments, supporting automatic SSL management. This guide provides step-by-step instructions for installing and configuring HAProxy and Traefik on a CentOS 9, 10, or 11 virtual machine running on Proxmox.
Step 1: Update Your System
Before installing any software, update your CentOS system to ensure all packages are up to date.
sudo dnf update -y
Installing HAProxy
HAProxy is available in the default CentOS repositories.
- Install HAProxy
sudo dnf install haproxy -y
- Configure HAProxy
The main configuration file is located at /etc/haproxy/haproxy.cfg. Open the file for editing.
sudo nano /etc/haproxy/haproxy.cfg
Add or modify the configuration as needed. Here is an example of a basic HAProxy configuration:
frontend http_front
bind *:80
default_backend http_back
backend http_back
balance roundrobin
server server1 192.168.1.2:80 check
server server2 192.168.1.3:80 check
Save and exit the file.
- Start and Enable HAProxy
Start HAProxy and enable it to start automatically on boot.
sudo systemctl start haproxy
sudo systemctl enable haproxy
To verify that HAProxy is running correctly, check its status.
sudo systemctl status haproxy
- Configure the Firewall
Allow HTTP traffic through the firewall.
sudo firewall-cmd –permanent –add-service=http
sudo firewall-cmd –reload
Installing Traefik
Traefik can be installed using Snap.
- Install Snapd
sudo dnf install epel-release -y
sudo dnf install snapd -y
Enable and start the Snap service.
sudo systemctl enable –now snapd.socket
Create a symbolic link for Snap.
sudo ln -s /var/lib/snapd/snap /snap
Log out and log back in to apply changes.
- Install Traefik
sudo snap install traefik
- Configure Traefik
Create the configuration directory.
sudo mkdir -p /etc/traefik
Create the main configuration file.
sudo nano /etc/traefik/traefik.yml
Add the following configuration:
entryPoints:
web:
address: “:80”
providers:
file:
filename: /etc/traefik/dynamic_conf.yml
Save and exit the file.
Create the dynamic configuration file.
sudo nano /etc/traefik/dynamic_conf.yml
Add the following content:
http:
routers:
my-router:
rule: “Host(example.com)”
service: my-service
services:
my-service:
loadBalancer:
servers:
– url: “http://192.168.1.2“
– url: “http://192.168.1.3“
Save and exit the file.
- Start Traefik
To run Traefik using Docker, use the following command:
docker run -d -p 80:80 -p 8080:8080 -v /etc/traefik/traefik.yml:/etc/traefik/traefik.yml -v /etc/traefik/dynamic_conf.yml:/etc/traefik/dynamic_conf.yml traefik:v2.4
Conclusion
By following these steps, you have successfully installed and configured HAProxy and Traefik on a CentOS virtual machine running on Proxmox.
- HAProxy is configured to balance HTTP traffic across multiple backend servers.
- Traefik is installed and set up as a modern reverse proxy, ready to handle dynamic environments.
Ensure that your firewall rules allow necessary traffic and review the logs for troubleshooting. You can now integrate SSL certificates and enhance security as needed.
Information reviewed and updated: August 28, 2026.
Published by: REVOLD BLOG – blog.revold.us
Powered by AIR RISE INC & REVOLD AI
Sponsored: CORPIUS
Author: Roman Kravchina
Related Reading on Revold Blog
- How to Install Searx Search Engine on Ubuntu / debianArch LinuxFedora / RHEL
- How to Install UniFi Controller on Ubuntu 22.04 or 24.04
- What is DNS?
- Fixing YouTube Slowdowns at the Router Level
- More Developing & Programming guides
- How to install and configure Grafana on CentOS 9 or 10 or 11′
- How to Install and Configure iRedMail on CentOS 9, 10, or 11
- How to Install pfSense on Proxmox
- How to Install Jitsi Meet on Ubuntu/Debian with Automatic Let’s Encrypt SSL
- How to install Cockpit for Linux
- How to Configure SPF, DKIM, and DMARC on an iRedMail Server (CentOS 10 or 11)
- How to Install Python Pip on Ubuntu 22.04
- Proxmox Maintenance Script: Automate Updates and Reboots
- How to Install NGINX FastCGI Cache Purge Module Without Reinstalling NGINX on Ubuntu (Latest Versions)
- This guide will show you how to install a desktop (GUI) graphical interface on your Ubuntu server.
- Hot to install Search Engine with Docker image searx/searx — Linux Server, Home Lab


