Install HAProxy
Add the repository for HAProxy v2.4 with the following command:
sudo add-apt-repository ppa:vbernat/haproxy-2.4
Install HAProxy with the following commands:
sudo apt update
sudo apt install haproxy
Edit the HAProxy configuration with this command:
sudo nano /etc/haproxy/haproxy.cfg
If you ever need to update the version to a newer version, check the following site to see if the newer version exists:
https://launchpad.net/~vbernat/+ppa-packages
If it does, use the above commands substituting in the appropriate version to add the newer version's repository and upgrade HAProxy. Once HAProxy is upgraded and verified working, use the following command to remove the old version (again substituting the old version number):
sudo add-apt-repository --remove ppa:vbernat/haproxy-2.3