How To Install HAProxy 2.2 on Debian 10

Load balancing is a common solution for a website with a lot of traffic. HAProxy offers high availability which can be used for distributing database or web application accross multiple servers even multiple different cloud providers.

Here are few HAProxy 2.2 features
– Dynamic SSL Certificate Storage
– SSL/TLS Enhancements
– Native Response Generator
– Dynamic Error Handling
– New Health Check
– Syslog over TCP

Install Dependency

Install the dependency using apt-get package manager

sudo apt-get install gnupg2 curl -y

Add HAProxy Repository

On the official Debian 10 repository, there’s only HAProxy 1.8.x. available to install the latest HAProxy we’ll need to use 3rd party repository. These repositories actually created by the HAProxy team on Debian, but not included on the official repository on default installation.

Download GPG key repository

curl https://haproxy.debian.net/bernat.debian.org.gpg | sudo apt-key add -

Add HAProxy repository to apt

echo deb http://haproxy.debian.net buster-backports-2.2 main | sudo tee /etc/apt/sources.list.d/haproxy.list

Run apt-get update, to download latest link for HAProxy

sudo apt-get update

Install HAProxy 2.2

Install HAProxy 2.2 then stick to these major version.

apt-get install haproxy=2.2.\*

Run HAProxy

HAProxy has systemd file services, we can manage the service using systemctl

sudo systemctl start haproxy

to activated haproxy on boot run following command

sudo systemctl enable haproxy

Leave a Comment