# How to upgrade HAProxy

**URL:** https://discourse.haproxy.org/t/how-to-upgrade-haproxy/5515
**Category:** Help!
**Created:** [July 23, 2020, 5:58am UTC](https://discourse.haproxy.org/t/how-to-upgrade-haproxy/5515 "2020-07-23T05:58:17Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ronnie](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/ronnie/32/1144_2.png) [@ronnie](https://discourse.haproxy.org/u/ronnie)
#### Post date: [July 23, 2020, 5:58am UTC](https://discourse.haproxy.org/t/how-to-upgrade-haproxy/5515/1 "2020-07-23T05:58:17Z")

</div>

I created a BASH Script to automate the Build Process for HAProxy on CentOS 7. It is here: [https://github.com/ronnie-lazarus/Shell-Scripts/tree/master/HAProxy%20Build%20(with%20LUA)%20over%20CentOS%207](https://github.com/ronnie-lazarus/Shell-Scripts/tree/master/HAProxy%20Build%20(with%20LUA)%20over%20CentOS%207)

I’ve been using this for all my server installs. However, the question I always had in my mind was how to upgrade if I ever needed it. Do I just compile the new binaries and replaces the sbin directory? What would be the specifics? Any help is much appreciated.

Thanks,

---

<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: [July 25, 2020, 4:13pm UTC](https://discourse.haproxy.org/t/how-to-upgrade-haproxy/5515/2 "2020-07-25T16:13:25Z")

</div>

make install and restarting the process suffices.

---

<div class="post-metadata">

### Author: ![ronnie](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/ronnie/32/1144_2.png) [@ronnie](https://discourse.haproxy.org/u/ronnie)
#### Post date: [July 28, 2020, 8:55am UTC](https://discourse.haproxy.org/t/how-to-upgrade-haproxy/5515/3 "2020-07-28T08:55:54Z")

</div>

I see. Sorry for the extremely specific question but basically I re-download the source code, extract it, and do:

> make USE\_NS=1 USE\_TFO=1 USE\_OPENSSL=1 USE\_ZLIB=1 USE\_LUA=1 USE\_PCRE=1 USE\_SYSTEMD=1 USE\_LIBCRYPT=1 USE\_THREAD=1 TARGET=linux-glibc EXTRA\_OBJS=“contrib/prometheus-exporter/service-prometheus.o” LUA\_INC=$lualocalinstalldir/include LUA\_LIB=$lualocalinstalldir/lib && make install

And this will basically not just recompile but also replace every single binary that gets created through the process without any conflict?

Also, what would your thoughts be on my script? Care to comment?

Thanks,

---

<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: [July 28, 2020, 10:24pm UTC](https://discourse.haproxy.org/t/how-to-upgrade-haproxy/5515/4 "2020-07-28T22:24:33Z")

</div>

> [@ronnie](#):
>
> And this will basically not just recompile but also replace every single binary that gets created through the process without any conflict?

Yes, unless the old release has binaries that the new release has not. For example 1.7 has `haproxy-systemd-wrapper` which is removed from 1.8+. But `make install` from 1.8 wont do anything about the old `haproxy-systemd-wrapper`.

Also, a part from the binaries, every other step has to be done also, like updating the unit file for systemd. So your script needs to take care of that, just like it needs to take care to not do the same thing multiple times.

Like if you run your script 5 times, how does the rsyslog configuration looks like, does it have 5 times the logging config?

> [@ronnie](#):
>
> Also, what would your thoughts be on my script? Care to comment?

Not sure why you would need to build on every box, as opposed to just build a rpm once and use that, but I admit I don’t know your specific use-case.

---

<div class="post-metadata">

### Author: ![ronnie](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/ronnie/32/1144_2.png) [@ronnie](https://discourse.haproxy.org/u/ronnie)
#### Post date: [August 3, 2020, 10:05am UTC](https://discourse.haproxy.org/t/how-to-upgrade-haproxy/5515/5 "2020-08-03T10:05:33Z")

</div>

> [@lukastribus](#):
>
> Also, a part from the binaries, every other step has to be done also, like updating the unit file for systemd. So your script needs to take care of that, just like it needs to take care to not do the same thing multiple times.
> 
> Like if you run your script 5 times, how does the rsyslog configuration looks like, does it have 5 times the logging config?

Yes, I have taken this into consideration. My script will not initialize in case an existing install (I understand this term can be very vague) is detected. And every command put in there will basically just overwrite or create new files. Thanks for your suggestions however though.

> [@lukastribus](#):
>
> Not sure why you would need to build on every box, as opposed to just build an rpm once and use that, but I admit I don’t know your specific use-case.

This is simply because I’ve never built an RPM yet 🙂 I am however very much encouraged with your suggestion and I feel that it should be my next best step. Though I wonder why hasn’t anybody just already done that yet? Would you happen to have some leads on it? I do know of the Enterprise version, however.

And once again I would like to extend my deepest thanks to you and the developers of such a robust tool and keeping it open source as well as continuously helping us folks with all of our doubts. If possible I would definitely want to add to the community somehow maybe by building that RPM you just talked about if it isn’t already there 🙂

---

<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: [August 3, 2020, 9:04pm UTC](https://discourse.haproxy.org/t/how-to-upgrade-haproxy/5515/6 "2020-08-03T21:04:38Z")

</div>

I never build an RPM either, I don’t know the process (I just think it’s the right tool for the job).

Maybe this can help:

[https://rpm-packaging-guide.github.io/](https://rpm-packaging-guide.github.io/)
