# How to install HAProxy on CentOS 7 Minimal

**URL:** https://discourse.haproxy.org/t/how-to-install-haproxy-on-centos-7-minimal/2461
**Category:** Help!
**Created:** [May 4, 2018, 2:04pm UTC](https://discourse.haproxy.org/t/how-to-install-haproxy-on-centos-7-minimal/2461 "2018-05-04T14:04:06Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Atticraider](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Atticraider](https://discourse.haproxy.org/u/Atticraider)
#### Post date: [May 4, 2018, 2:04pm UTC](https://discourse.haproxy.org/t/how-to-install-haproxy-on-centos-7-minimal/2461/1 "2018-05-04T14:04:06Z")

</div>

Afternoon All,

I’ve been asked to install HAProxy on CentOS 7 Minimal however I don’t seem to be able to add/install it. Could someone be so kind and tell me how I can get this added/installed please.

Regards  
Andy

 ![dan](https://us1.discourse-cdn.com/flex016/uploads/haproxy/original/1X/d5cc9d7a2798c29a0fad034ca2a27f816f6cbe17.PNG)

---

<div class="post-metadata">

### Author: ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)
#### Post date: [May 4, 2018, 2:32pm UTC](https://discourse.haproxy.org/t/how-to-install-haproxy-on-centos-7-minimal/2461/2 "2018-05-04T14:32:56Z")

</div>

You need to have connectivity to the Internet for yum to be able to install haproxy from the repositories.

---

<div class="post-metadata">

### Author: ![Atticraider](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Atticraider](https://discourse.haproxy.org/u/Atticraider)
#### Post date: [May 4, 2018, 2:59pm UTC](https://discourse.haproxy.org/t/how-to-install-haproxy-on-centos-7-minimal/2461/3 "2018-05-04T14:59:30Z")

</div>

I have given CentOS 7 access to the internet but when I type “yum install haproxy” I still get the same error message.

Do I need to do something else before I type this command?

---

<div class="post-metadata">

### Author: ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)
#### Post date: [May 4, 2018, 3:11pm UTC](https://discourse.haproxy.org/t/how-to-install-haproxy-on-centos-7-minimal/2461/4 "2018-05-04T15:11:32Z")

</div>

You need working connectivity to the Internet, that includes working DNS resolution.

As you can see from the error message above, CentOS is unable to resolve [mirrorlist.centos.org](http://mirrorlist.centos.org):  
`Could not resolve host: mirrorlist.centos.org`

---

<div class="post-metadata">

### Author: ![Atticraider](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Atticraider](https://discourse.haproxy.org/u/Atticraider)
#### Post date: [May 4, 2018, 3:25pm UTC](https://discourse.haproxy.org/t/how-to-install-haproxy-on-centos-7-minimal/2461/5 "2018-05-04T15:25:21Z")

</div>

I just figured out how I can install HAProxy, first I had to type the following commands.

1: ONBOOT=no  
2: dhclient  
3: yum install haproxy

Thanks for your help anyway.

---

<div class="post-metadata">

### Author: ![warnox](https://avatars.discourse-cdn.com/v4/letter/w/7bcc69/32.png) [@warnox](https://discourse.haproxy.org/u/warnox)
#### Post date: [May 9, 2018, 11:45am UTC](https://discourse.haproxy.org/t/how-to-install-haproxy-on-centos-7-minimal/2461/6 "2018-05-09T11:45:19Z")

</div>

It’s probably worth compiling/installing manually, to get the latest version. It’s pretty straightforward.

---

<div class="post-metadata">

### Author: ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)
#### Post date: [May 9, 2018, 3:58pm UTC](https://discourse.haproxy.org/t/how-to-install-haproxy-on-centos-7-minimal/2461/7 "2018-05-09T15:58:57Z")

</div>

It’s not straightforward for everyone at all. The OP in this thread struggled to get the CentOS box connected to the Internet, so I would strongly recommend against compiling from source.

---

<div class="post-metadata">

### Author: ![warnox](https://avatars.discourse-cdn.com/v4/letter/w/7bcc69/32.png) [@warnox](https://discourse.haproxy.org/u/warnox)
#### Post date: [May 17, 2018, 3:12pm UTC](https://discourse.haproxy.org/t/how-to-install-haproxy-on-centos-7-minimal/2461/8 "2018-05-17T15:12:58Z")

</div>

Fair comment. I didn’t have my notes on me at the time but will post them below now, might be of use to someone.

1. Download the installation files and extract content.

2. Install pre-requisites

`yum install openssl-devel pcre-devel zlib-devel gcc`

1. Compile source

`sudo make TARGET=linux2628 USE_OPENSSL=1 USE_PCRE=1 USE_ZLIB=1`

1. Install and complete installation

2. Start HAProxy and Check the service status
