# Instalação HAPROXY docker

# Instalação HAproxy Docker HAproxytec

Link: [https://hub.docker.com/r/haproxytech/haproxy-debian](https://hub.docker.com/r/haproxytech/haproxy-debian)

- <span style="color: rgb(187, 187, 187); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 2.333em; font-weight: 400;">Quick reference</span>

- **Where to get help**:  
    [HAProxy mailing list⁠](mailto:haproxy@formilux.org), [HAProxy Community Slack⁠](https://slack.haproxy.org/) or [\#haproxy on Libera.chat⁠](irc://irc.libera.chat/%23haproxy)
- **Where to file issues**:  
    [https://github.com/haproxytech/haproxy-docker-debian/issues⁠](https://github.com/haproxytech/haproxy-docker-debian/issues)
- **Maintained by**:  
    [HAProxy Technologies⁠](https://github.com/haproxytech)
- **Supported architectures**: ([more info⁠](https://github.com/docker-library/official-images#architectures-other-than-amd64))  
    `linux/amd64`, `linux/arm64`, `linux/arm/v7`
- **Image updates**:  
    [commits to `haproxytech/haproxy-docker-debian`⁠](https://github.com/haproxytech/haproxy-docker-debian/commits/main), [top level `haproxytech/haproxy-docker-debian` image folder⁠](https://github.com/haproxytech/haproxy-docker-debian)
- **Source of this description**:  
    [README.md⁠](https://github.com/haproxytech/haproxy-docker-debian/blob/main/README.md)

### What is HAProxy?

HAProxy is the fastest and most widely used open-source load balancer and application delivery controller. Written in C, it has a reputation for efficient use of both processor and memory. It can proxy at either layer 4 (TCP) or layer 7 (HTTP) and has additional features for inspecting, routing and modifying HTTP messages.

It comes bundled with a web UI, called the HAProxy Stats page, that you can use to monitor error rates, the volume of traffic and latency. Features can be toggled on by updating a single configuration file, which provides a syntax for defining routing rules, rate limiting, access controls, and more.

Other features include:

- SSL/TLS termination
- Gzip compression
- Health checking
- HTTP/2
- gRPC support
- Lua scripting
- DNS service discovery
- Automatic retries of failed conenctions
- Verbose logging

![logo](https://www.haproxy.org/img/HAProxyCommunityEdition_60px.png)

### How to use this image

This image is being shipped with a trivial sample configuration and for any real life use it should be configured according to the [extensive documentation⁠](https://docs.haproxy.org/) and [examples⁠](https://github.com/haproxy/haproxy/tree/master/examples). We will now show how to override shipped haproxy.cfg with one of your own.

#### Create a `Dockerfile`

```dockerfile
FROM haproxytech/haproxy-debian:3.0
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg

```

#### Build the container

```console
$ docker build -t my-haproxy .

```

#### Test the configuration file

```console
$ docker run -it --rm my-haproxy haproxy -c -f /usr/local/etc/haproxy/haproxy.cfg

```

#### Run the container

```console
$ docker run -d --name my-running-haproxy my-haproxy

```

You will also need to publish the ports your HAProxy is listening on to the host by specifying the `-p` option, for example `-p 8080:80` to publish port 8080 from the container host to port 80 in the container.

#### Use volume for configuration persistency

```console
$ docker run -d --name my-running-haproxy -v /path/to/etc/haproxy:/usr/local/etc/haproxy:ro haproxytech/haproxy-debian:3.0

```

Note that your host's `/path/to/etc/haproxy` folder should be populated with a file named `haproxy.cfg` as well as any other accompanying files local to `/etc/haproxy`.

#### Reloading config

To be able to reload HAProxy configuration, you can send `SIGUSR2` to the container:

```console
$ docker kill -s USR2 my-running-haproxy

```

#### Enable Data Plane API

[Data Plane API⁠](https://www.haproxy.com/documentation/hapee/2-7r1/api/data-plane-api/) sidecar is being distributed by default in all 2.0+ images and to enable it there are a few steps required:

1. define one or more users through `userlist`
2. enable dataplane api process through `program api`
3. enable haproxy.cfg to be read/write mounted in Docker, either by defining volume being r/w or by rebuilding image with your own haproxy.cfg
4. expose dataplane TCP port in Docker with `--expose`

Relevant part of haproxy.cfg is below:

```bash
userlist haproxy-dataplaneapi
    user admin insecure-password mypassword

program api
   command /usr/bin/dataplaneapi --host 0.0.0.0 --port 5555 --haproxy-bin /usr/sbin/haproxy --config-file /usr/local/etc/haproxy/haproxy.cfg --reload-cmd "kill -SIGUSR2 1" --restart-cmd "kill -SIGUSR2 1" --reload-delay 5 --userlist haproxy-dataplaneapi
   no option start-on-reload

```

<div class="MuiBox-root css-14tyjzo" id="bkmrk--1" style="text-align: justify;"><div class="MuiStack-root css-1g4yje1"><div class="MuiBox-root css-mu0cnk">  
</div></div></div>To run such image we would use the following command (note that volume containing haproxy.cfg is mounted r/w and port tcp/5555 is being exposed):

```console
$ docker run -d --name my-running-haproxy --expose 5555 -v /path/to/etc/haproxy:/usr/local/etc/haproxy:rw haproxytech/haproxy-debian

```

### License

View [license information⁠](https://raw.githubusercontent.com/haproxy/haproxy/master/LICENSE) for the software contained in this image.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

# Instalação HAproxy Docker Bitnami

Link: https://github.com/bitnami/containers/tree/main/bitnami/haproxy

<div class="markdown-heading" dir="auto" id="bkmrk-" style="text-align: justify;">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>](https://github.com/bitnami/containers/tree/main/bitnami/haproxy#what-is-haproxy)</div>> HAProxy is a TCP proxy and a HTTP reverse proxy. It supports SSL termination and offloading, TCP and HTTP normalization, traffic regulation, caching and protection against DDoS attacks.

[Overview of HAProxy](https://www.haproxy.org/) Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.

<div class="markdown-heading" dir="auto" id="bkmrk--2" style="text-align: justify;">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>](https://github.com/bitnami/containers/tree/main/bitnami/haproxy#tldr)</div>```
docker run --name haproxy bitnami/haproxy:latest
```

<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" id="bkmrk--4" style="text-align: justify;"><div class="zeroclipboard-container"><svg aria-hidden="true" class="octicon octicon-copy js-clipboard-copy-icon" data-view-component="true" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg></div></div>## ⚠️ Important Notice: Upcoming changes to the Bitnami Catalog

<div class="markdown-heading" dir="auto" id="bkmrk--5" style="text-align: justify;">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>](https://github.com/bitnami/containers/tree/main/bitnami/haproxy#%EF%B8%8F-important-notice-upcoming-changes-to-the-bitnami-catalog)</div>Beginning August 28th, 2025, Bitnami will evolve its public catalog to offer a curated set of hardened, security-focused images under the new [Bitnami Secure Images initiative](https://news.broadcom.com/app-dev/broadcom-introduces-bitnami-secure-images-for-production-ready-containerized-applications). As part of this transition:

- Granting community users access for the first time to security-optimized versions of popular container images.
- Bitnami will begin deprecating support for non-hardened, Debian-based software images in its free tier and will gradually remove non-latest tags from the public catalog. As a result, community users will have access to a reduced number of hardened images. These images are published only under the “latest” tag and are intended for development purposes
- Starting August 28th, over two weeks, all existing container images, including older or versioned tags (e.g., 2.50.0, 10.6), will be migrated from the public catalog (docker.io/bitnami) to the “Bitnami Legacy” repository (docker.io/bitnamilegacy), where they will no longer receive updates.
- For production workloads and long-term support, users are encouraged to adopt Bitnami Secure Images, which include hardened containers, smaller attack surfaces, CVE transparency (via VEX/KEV), SBOMs, and enterprise support.

These changes aim to improve the security posture of all Bitnami users by promoting best practices for software supply chain integrity and up-to-date deployments. For more details, visit the [Bitnami Secure Images announcement](https://github.com/bitnami/containers/issues/83267).

## Why use Bitnami Images?

<div class="markdown-heading" dir="auto" id="bkmrk--7" style="text-align: justify;">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>](https://github.com/bitnami/containers/tree/main/bitnami/haproxy#why-use-bitnami-images)</div>- Bitnami closely tracks upstream source changes and promptly publishes new versions of this image using our automated systems.
- With Bitnami images the latest bug fixes and features are available as soon as possible.
- Bitnami containers, virtual machines and cloud images use the same components and configuration approach - making it easy to switch between formats based on your project needs.
- All our images are based on [**minideb**](https://github.com/bitnami/minideb) -a minimalist Debian based container image that gives you a small base container image and the familiarity of a leading Linux distribution- or **scratch** -an explicitly empty image-.
- All Bitnami images available in Docker Hub are signed with [Notation](https://notaryproject.dev/). [Check this post](https://blog.bitnami.com/2024/03/bitnami-packaged-containers-and-helm.html) to know how to verify the integrity of the images.
- Bitnami container images are released on a regular basis with the latest distribution packages available.

Looking to use HAProxy in production? Try [VMware Tanzu Application Catalog](https://bitnami.com/enterprise), the commercial edition of the Bitnami catalog.

## Supported tags and respective `Dockerfile` links

<div class="markdown-heading" dir="auto" id="bkmrk--9" style="text-align: justify;">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>](https://github.com/bitnami/containers/tree/main/bitnami/haproxy#supported-tags-and-respective-dockerfile-links)</div>Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://techdocs.broadcom.com/us/en/vmware-tanzu/application-catalog/tanzu-application-catalog/services/tac-doc/apps-tutorials-understand-rolling-tags-containers-index.html).

You can see the equivalence between the different tags by taking a look at the `tags-info.yaml` file present in the branch folder, i.e `bitnami/ASSET/BRANCH/DISTRO/tags-info.yaml`.

Subscribe to project updates by watching the [bitnami/containers GitHub repo](https://github.com/bitnami/containers).

## Get this image

<div class="markdown-heading" dir="auto" id="bkmrk--11" style="text-align: justify;">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>](https://github.com/bitnami/containers/tree/main/bitnami/haproxy#get-this-image)</div>The recommended way to get the Bitnami haproxy Docker Image is to pull the prebuilt image from the [Docker Hub Registry](https://hub.docker.com/r/bitnami/haproxy).

```
docker pull bitnami/haproxy:latest
```

<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" id="bkmrk--13" style="text-align: justify;"><div class="zeroclipboard-container"><svg aria-hidden="true" class="octicon octicon-copy js-clipboard-copy-icon" data-view-component="true" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg></div></div>To use a specific version, you can pull a versioned tag. You can view the [list of available versions](https://hub.docker.com/r/bitnami/haproxy/tags/) in the Docker Hub Registry.

```
docker pull bitnami/haproxy:[TAG]
```

<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" id="bkmrk--14" style="text-align: justify;"><div class="zeroclipboard-container"><svg aria-hidden="true" class="octicon octicon-copy js-clipboard-copy-icon" data-view-component="true" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg></div></div>If you wish, you can also build the image yourself by cloning the repository, changing to the directory containing the Dockerfile and executing the `docker build` command. Remember to replace the `APP`, `VERSION` and `OPERATING-SYSTEM` path placeholders in the example command below with the correct values.

```
git clone https://github.com/bitnami/containers.git
cd bitnami/APP/VERSION/OPERATING-SYSTEM
docker build -t bitnami/APP:latest .
```

<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" id="bkmrk--15" style="text-align: justify;"><div class="zeroclipboard-container"><svg aria-hidden="true" class="octicon octicon-copy js-clipboard-copy-icon" data-view-component="true" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg></div></div>## Why use a non-root container?

<div class="markdown-heading" dir="auto" id="bkmrk--16" style="text-align: justify;">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>](https://github.com/bitnami/containers/tree/main/bitnami/haproxy#why-use-a-non-root-container)</div>Non-root container images add an extra layer of security and are generally recommended for production environments. However, because they run as a non-root user, privileged tasks are typically off-limits. Learn more about non-root containers [in our docs](https://techdocs.broadcom.com/us/en/vmware-tanzu/application-catalog/tanzu-application-catalog/services/tac-doc/apps-tutorials-work-with-non-root-containers-index.html).

## Configuration

<div class="markdown-heading" dir="auto" id="bkmrk--18" style="text-align: justify;">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>](https://github.com/bitnami/containers/tree/main/bitnami/haproxy#configuration)</div>### Running commands

<div class="markdown-heading" dir="auto" id="bkmrk--20" style="text-align: justify;">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>](https://github.com/bitnami/containers/tree/main/bitnami/haproxy#running-commands)</div>To run commands inside this container you can use `docker run`, for example to execute `haproxy --version` you can follow the example below:

```
docker run --rm --name haproxy bitnami/haproxy:latest -- --version
```

<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" id="bkmrk--22" style="text-align: justify;"><div class="zeroclipboard-container"><svg aria-hidden="true" class="octicon octicon-copy js-clipboard-copy-icon" data-view-component="true" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg></div></div>In order for the container to work, you need to mount your custom `haproxy.cfg` file in `/bitnami/haproxy/conf/`. The following example runs HAProxy with a custom configuration file:

```
docker run --rm --name haproxy -v /path/to/haproxy.cfg:/bitnami/haproxy/conf/haproxy.cfg bitnami/haproxy:latest
```

<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" id="bkmrk--23" style="text-align: justify;"><div class="zeroclipboard-container"><svg aria-hidden="true" class="octicon octicon-copy js-clipboard-copy-icon" data-view-component="true" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg></div></div>Using docker-compose:

```
version: '2'
services:

  haproxy:
    image: bitnami/haproxy:latest
    volumes:
      - /path/to/haproxy.cfg:/bitnami/haproxy/conf/haproxy.cfg
```

<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" id="bkmrk--24" style="text-align: justify;"><div class="zeroclipboard-container"><svg aria-hidden="true" class="octicon octicon-copy js-clipboard-copy-icon" data-view-component="true" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg></div></div>Check the [official HAProxy documentation](http://cbonte.github.io/haproxy-dconv/2.5/configuration.html) to understand the possible configurations.

## Using `docker-compose.yaml`

<div class="markdown-heading" dir="auto" id="bkmrk--25" style="text-align: justify;">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>](https://github.com/bitnami/containers/tree/main/bitnami/haproxy#using-docker-composeyaml)</div>Please be aware this file has not undergone internal testing. Consequently, we advise its use exclusively for development or testing purposes. For production-ready deployments, we highly recommend utilizing its associated [Bitnami Helm chart](https://github.com/bitnami/charts/tree/main/bitnami/haproxy).

If you detect any issue in the `docker-compose.yaml` file, feel free to report it or contribute with a fix by following our [Contributing Guidelines](https://github.com/bitnami/containers/blob/main/CONTRIBUTING.md).

## Contributing

<div class="markdown-heading" dir="auto" id="bkmrk--27" style="text-align: justify;">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>](https://github.com/bitnami/containers/tree/main/bitnami/haproxy#contributing)</div>We'd love for you to contribute to this container. You can request new features by creating an [issue](https://github.com/bitnami/containers/issues) or submitting a [pull request](https://github.com/bitnami/containers/pulls) with your contribution.

## Issues

<div class="markdown-heading" dir="auto" id="bkmrk--29" style="text-align: justify;">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>](https://github.com/bitnami/containers/tree/main/bitnami/haproxy#issues)</div>If you encountered a problem running this container, you can file an [issue](https://github.com/bitnami/containers/issues/new/choose). For us to provide better support, be sure to fill the issue template.

## License

<div class="markdown-heading" dir="auto" id="bkmrk--31" style="text-align: justify;">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>](https://github.com/bitnami/containers/tree/main/bitnami/haproxy#license)</div>Copyright © 2025 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

# How to Run HAProxy With Docker (In-Depth Guide)

Link: [https://www.haproxy.com/blog/how-to-run-haproxy-with-docker](https://www.haproxy.com/blog/how-to-run-haproxy-with-docker)

<time class="text-sm md:text-base" datetime="2025-08-01">August 1st, 2025  
</time>8 min read

<div class="w-full component gradient-topglow dark" id="bkmrk-nick-ramirez" style="text-align: justify;"><header class="container flex flex-row flex-nowrap mx-auto  pb-[96px] md:pb-[196px] !pt-[114px] lg:!pt-[228px]">[Nick Ramirez](https://www.haproxy.com/blog/author/nramirez)

</header></div><div class="container mx-auto" id="bkmrk-can-you-run-haproxy-" style="text-align: justify;"><div class="flex flex-row w-full flex-nowrap"><main class="post-content anchorise shrink px-default mx-auto overflow-x-hidden mt-[-70px] md:mt-[-170px]"><div class="min-h-[148px] lg:min-h-[366px] mb-6 rounded-lg max-w-[1000px] mx-auto"><picture class="w-full  "><source media="(min-width: 1024px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/run-haproxy-with-docker.png/e1b8e67997f6fb87216189d3aeb3b6a1/run-haproxy-with-docker.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/run-haproxy-with-docker.png/5f6ad7a860d8537608dcae12c93766cd/run-haproxy-with-docker.png 2x"><source media="(min-width: 768px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/run-haproxy-with-docker.png/b4482b565ad9c980d35b731332244063/run-haproxy-with-docker.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/run-haproxy-with-docker.png/5f6ad7a860d8537608dcae12c93766cd/run-haproxy-with-docker.png 2x"><source media="(min-width: 480px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/run-haproxy-with-docker.png/b4482b565ad9c980d35b731332244063/run-haproxy-with-docker.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/run-haproxy-with-docker.png/5f6ad7a860d8537608dcae12c93766cd/run-haproxy-with-docker.png 2x"><source media="(max-width: 479px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/run-haproxy-with-docker.png/c8be3f44025faa00d10d6547052f91f6/run-haproxy-with-docker.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/run-haproxy-with-docker.png/d9c884214474c654370a911912fd27a1/run-haproxy-with-docker.png 2x"></source></source></source></source></picture></div>Can you run HAProxy as a Docker container? Yes! Did you even need to ask? Docker is ubiquitous these days and you’ll find that many applications have been *Docker-ized*; the HAProxy load balancer is no exception. Pardon the cliché, but HAProxy was born for this. As a standalone service that runs on Linux, porting it to Docker certainly seemed natural.

<div class="mx-auto prose prose-md"><div class="did-you-know info not-prose"><div class="did-you-know__title">Need advanced, enterprise-grade features?</div><div class="mt-3">  
</div></div></div>[HAProxy Enterprise](https://www.haproxy.com/products/haproxy-enterprise) is a flexible data plane layer that provides high-performance load balancing for TCP, UDP, QUIC, and HTTP-based applications, high availability, an API/AI gateway, Kubernetes application routing, SSL processing, DDoS protection, bot management, global rate limiting, and a next-generation WAF.

HAProxy Enterprise is a core component of [HAProxy One](https://www.haproxy.com/products/haproxy-one): the world's fastest application delivery and security platform that is the G2 category leader in API management, container networking, DDoS protection, web application firewall (WAF), and load balancing.

Why would you want to run your load balancer inside of a Docker container? Are their performance penalties when doing so? Will it introduce any security issues?

In this blog post, you’ll learn why you might consider running HAProxy inside a container and what the ramifications could be. Then you’ll see how to do it. Note that if you want to use HAProxy for Kubernetes traffic management, we encourage you to view [our Kubernetes solution](https://www.haproxy.com/solutions/kubernetes) to see what’s possible.

HAProxy Technologies builds its own set of Docker images under its namespace *haproxytech*. These are updated regularly with the latest patches and security updates. I will be using those images in this blog post. You’ll find them here:

<div class="mx-auto prose prose-md">- HAProxy (Alpine Linux base)- [https://hub.docker.com/r/haproxytech/haproxy-alpine](https://hub.docker.com/r/haproxytech/haproxy-alpine)
- HAProxy (Ubuntu base) – [https://hub.docker.com/r/haproxytech/haproxy-ubuntu](https://hub.docker.com/r/haproxytech/haproxy-ubuntu)
- HAProxy (Debian base) – [https://hub.docker.com/r/haproxytech/haproxy-debian](https://hub.docker.com/r/haproxytech/haproxy-debian)

</div>The commands I demonstrate were performed on a Linux workstation but will work just as well when using Docker Desktop for Windows or Docker Desktop for Mac.

## [​#](https://www.haproxy.com/blog/how-to-run-haproxy-with-docker#the-benefits-of-docker)[The Benefits of Docker](https://www.haproxy.com/blog/how-to-run-haproxy-with-docker#the-benefits-of-docker)

Do you want the ability to run HAProxy without needing to compile it, install dependencies, or otherwise alter your system?

Docker containers bring considerable benefits, chief among them being less ceremony around installation and execution. Docker allows you to drop a container onto a host system and instantly get a running service—no install scripts, no installing C libraries. The service is completely contained within the container and all you need to do is start it and then map a TCP port to it. When you deploy a container, you gain the ability to run an entire application complete with its runtime environment without ever actually installing it onto the host system.

Lifecycle management becomes standardized too. Starting, stopping, and removing a container is as easy as calling one-line *docker* commands. That in turn makes deployment a repeatable and testable process. It also lends itself to easier software upgrades.

## [​#](https://www.haproxy.com/blog/how-to-run-haproxy-with-docker#the-performance-impact-of-running-docker)[The Performance Impact of Running Docker](https://www.haproxy.com/blog/how-to-run-haproxy-with-docker#the-performance-impact-of-running-docker)

You want your load balancer to be fast, with no added latency from the environment. So, the question is, what is the impact of running HAProxy inside of a container?

In terms of CPU overhead, it helps to remember that, unlike a virtual machine, Docker does not require a layer of virtualization on top of the host operating system. A container runs on the host’s kernel and is basically just another process, albeit one with better isolation from other processes running on the host (it uses *[namespaces](https://en.wikipedia.org/wiki/Linux_namespaces)* to accomplish this). It should come as little surprise then that a [study by researchers at IBM](https://dominoweb.draco.res.ibm.com/reports/rc25482.pdf) found that the CPU overhead of using Docker is negligible.

Networking is another story. By default, Docker lets you access the services running inside containers by creating a [bridge network](https://docs.docker.com/network/bridge/) to the host. This does incur latency due to the network address translation (NAT) that must happen between the container’s local network and the host’s bridge network. In the same IBM study cited before, the researchers found that Docker’s NAT doubled latency from roughly 35 µs to 70 µs for a 100-byte request from the client and a 200-byte response from the application.

On the other hand, bridge networks are useful because they allow you to isolate groups of containers into a container-only network and expose only some of those containers to the host, which is handy for reducing the number of IP addresses required on your host’s network (think about the number of IPs required to run hundreds or possibly thousands of containers).

If you require very low latency you can switch to using Docker’s [host network](https://docs.docker.com/network/host/) feature, which allows your container to share the same network as the host, cutting out the need for NAT. Then again, that doesn’t touch on what to do if you want to run Docker Swarm or Kubernetes, which use [overlay networks](https://docs.docker.com/network/overlay/), for which different network drivers like Project Calico and Cilium have solutions. However, that is outside the scope of this article.

In short, unless you require very low latency, you should be fine sticking with the default bridge networking option. Just be sure to test it out and see if you’re getting the throughput you need.

## [​#](https://www.haproxy.com/blog/how-to-run-haproxy-with-docker#security-considerations-of-running-docker)[Security Considerations of Running Docker](https://www.haproxy.com/blog/how-to-run-haproxy-with-docker#security-considerations-of-running-docker)

You may be concerned by the fact that many Docker containers run their service as *root*, and this root user is the same root user as on the host system. Concerns about a container breakout are legitimate. HAProxy runs as root too. However, to put your mind at ease: HAProxy requires root access because it needs to bind to restricted TCP ports like 80 and 443. However, once it has finished its startup, it drops its root privileges and runs as an unprivileged user.

People also weigh the risk that a container may be malicious. This is a good reason to stick with the *haproxytech* Docker images, which are curated by HAProxy Technologies.

## [​#](https://www.haproxy.com/blog/how-to-run-haproxy-with-docker#run-haproxy-with-docker)[Run Haproxy With Docker](https://www.haproxy.com/blog/how-to-run-haproxy-with-docker#run-haproxy-with-docker)

We’ll create three instances of a web application, one instance of HAProxy, and a bridge network to join them together. So, once you’ve installed Docker, use the following command to create a new bridge network in Docker:

<div class="mx-auto prose prose-md"><div class="my-8 post-gist not-prose  "><div class="gist"><div class="gist-file" data-color-mode="light" data-light-theme="light" translate="no"><div class="gist-data"><div class="js-gist-file-update-container js-task-list-container"><div class="file my-2" id="bkmrk-%24-sudo-docker-networ"><div aria-label="blog20210802-01.sh content, created by haproxytechblog on 02:54PM on August 02, 2021." class="Box-body p-0 blob-wrapper data type-shell  " itemprop="text" role="region" tabindex="0"><div class="js-check-hidden-unicode js-blob-code-container blob-code-content"><table class="highlight tab-size js-file-line-container" data-hpc="" data-paste-markdown-skip="" data-tab-size="4" data-tagsearch-path="blog20210802-01.sh"><tbody><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-%24-sudo-docker-networ-1">$ sudo docker network create --driver=bridge mynetwork</td></tr></tbody></table>

</div></div></div></div></div><div class="gist-meta">[view raw](https://gist.github.com/haproxytechblog/d780483e153fd2d84f54719c94133992/raw/7c11dd62e89604bd2b8f43d7f81c79382dd5ce39/blog20210802-01.sh)</div></div></div></div></div>Then use the `docker run` command to create and run three instances of the web application. In this example, I use the Docker image [jmalloc/echo-server](https://hub.docker.com/r/jmalloc/echo-server). It’s a simple web app that returns back the details of the HTTP requests that you send to it.

<div class="mx-auto prose prose-md"><div class="my-8 post-gist not-prose  "><div class="gist"><div class="gist-file" data-color-mode="light" data-light-theme="light" translate="no"><div class="gist-data"><div class="js-gist-file-update-container js-task-list-container"><div class="file my-2" id="bkmrk-%24-sudo-docker-run--d"><div aria-label="blog20210802-02.sh content, created by haproxytechblog on 02:54PM on August 02, 2021." class="Box-body p-0 blob-wrapper data type-shell  " itemprop="text" role="region" tabindex="0"><div class="js-check-hidden-unicode js-blob-code-container blob-code-content"><table class="highlight tab-size js-file-line-container" data-hpc="" data-paste-markdown-skip="" data-tab-size="4" data-tagsearch-path="blog20210802-02.sh"><tbody><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-%24-sudo-docker-run--d-1">$ sudo docker run -d \\</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk---name-web1---net-my">--name web1 --net mynetwork jmalloc/echo-server:latest</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-"></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-%24-sudo-docker-run--d-2">$ sudo docker run -d \\</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk---name-web2---net-my">--name web2 --net mynetwork jmalloc/echo-server:latest</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk--1"></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-%24-sudo-docker-run--d-3">$ sudo docker run -d \\</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk---name-web3---net-my">--name web3 --net mynetwork jmalloc/echo-server:latest</td></tr></tbody></table>

</div></div></div></div></div><div class="gist-meta">[view raw](https://gist.github.com/haproxytechblog/d780483e153fd2d84f54719c94133992/raw/7c11dd62e89604bd2b8f43d7f81c79382dd5ce39/blog20210802-02.sh)</div></div></div></div></div>Notice that we assign each one a unique name and attach it to the bridge network we created. You should now have three web applications running, which you can verify by calling the `docker ps` command:

<div class="mx-auto prose prose-md"><div class="my-8 post-gist not-prose  "><div class="gist"><div class="gist-file" data-color-mode="light" data-light-theme="light" translate="no"><div class="gist-data"><div class="js-gist-file-update-container js-task-list-container"><div class="file my-2" id="bkmrk-%24-sudo-docker-ps-con"><div aria-label="blog20210802-03.sh content, created by haproxytechblog on 02:54PM on August 02, 2021." class="Box-body p-0 blob-wrapper data type-shell  " itemprop="text" role="region" tabindex="0"><div class="js-check-hidden-unicode js-blob-code-container blob-code-content"><table class="highlight tab-size js-file-line-container" data-hpc="" data-paste-markdown-skip="" data-tab-size="4" data-tagsearch-path="blog20210802-03.sh"><tbody><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-%24-sudo-docker-ps">$ sudo docker ps</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk--2"></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-container-id-image-c">CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-98216bb8c5ff-jmalloc">98216bb8c5ff jmalloc/echo-server:latest <span class="pl-s"><span class="pl-pds">"</span>/bin/echo-server<span class="pl-pds">"</span></span> About a minute ago Up About a minute 8080/tcp web3</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-ae6accc111d9-jmalloc">ae6accc111d9 jmalloc/echo-server:latest <span class="pl-s"><span class="pl-pds">"</span>/bin/echo-server<span class="pl-pds">"</span></span> About a minute ago Up About a minute 8080/tcp web2</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-554fafbc2b3b-jmalloc">554fafbc2b3b jmalloc/echo-server:latest <span class="pl-s"><span class="pl-pds">"</span>/bin/echo-server<span class="pl-pds">"</span></span> About a minute ago Up About a minute 8080/tcp web1</td></tr></tbody></table>

</div></div></div></div></div><div class="gist-meta">[view raw](https://gist.github.com/haproxytechblog/d780483e153fd2d84f54719c94133992/raw/7c11dd62e89604bd2b8f43d7f81c79382dd5ce39/blog20210802-03.sh)</div></div></div></div></div>These containers listen on their own port 8080, but we did not map those ports to the host, so they are not routable. We’ll relay traffic to these containers via the HAProxy load balancer. Next, let’s add HAProxy in front of them. Create a file named haproxy.cfg in the current directory and add the following to it:

<div class="mx-auto prose prose-md"><div class="my-8 post-gist not-prose  "><div class="gist"><div class="gist-file" data-color-mode="light" data-light-theme="light" translate="no"><div class="gist-data"><div class="js-gist-file-update-container js-task-list-container"><div class="file my-2" id="bkmrk-global-stats-socket-"><div aria-label="blog20210802-04.cfg content, created by haproxytechblog on 02:54PM on August 02, 2021." class="Box-body p-0 blob-wrapper data type-haproxy  " itemprop="text" role="region" tabindex="0"><div class="js-check-hidden-unicode js-blob-code-container blob-code-content"><table class="highlight tab-size js-file-line-container" data-hpc="" data-paste-markdown-skip="" data-tab-size="4" data-tagsearch-path="blog20210802-04.cfg"><tbody><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-global">global</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-stats-socket-%2Fvar%2Fru"><span class="pl-k"> stats</span> socket /var/run/api.sock<span class="pl-k"> user</span> haproxy<span class="pl-k"> group</span> haproxy<span class="pl-c1"> mode</span> <span class="pl-c1">660</span><span class="pl-c1"> level admin expose-fd</span> listeners</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-log-stdout-format-ra"><span class="pl-k"> log</span> stdout format raw<span class="pl-c1"> local0 info</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk--3"></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-defaults">defaults</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-mode-http"><span class="pl-k"> mode</span><span class="pl-c1"> http</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-timeout-client-10s"><span class="pl-k"> timeout</span><span class="pl-c1"> client</span> <span class="pl-c1">10s</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-timeout-connect-5s"><span class="pl-k"> timeout</span><span class="pl-c1"> connect</span> <span class="pl-c1">5s</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-timeout-server-10s"><span class="pl-k"> timeout server</span> <span class="pl-c1">10s</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-timeout-http-request"><span class="pl-k"> timeout</span><span class="pl-c1"> http-request</span> <span class="pl-c1">10s</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-log-global"><span class="pl-k"> log</span><span class="pl-c1"> global</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk--4"></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-frontend-stats">frontend <span class="pl-s">stats</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-bind-%2A%3A8404"><span class="pl-k"> bind</span> \*<span class="pl-v">:8404</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-stats-enable"><span class="pl-k"> stats enable</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-stats-uri-%2F"><span class="pl-k"> stats</span><span class="pl-c1"> uri</span> /</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-stats-refresh-10s"><span class="pl-k"> stats</span><span class="pl-c1"> refresh</span> <span class="pl-c1">10s</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk--5"></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-frontend-myfrontend">frontend <span class="pl-s">myfrontend</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-bind-%3A80"><span class="pl-k"> bind</span> <span class="pl-v">:80</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-default_backend-webs"><span class="pl-k"> default\_backend</span> webservers</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk--6"></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-backend-webservers">backend <span class="pl-s">webservers</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-server-s1-web1%3A8080-"><span class="pl-k"> server</span> s1 web1<span class="pl-v">:8080</span><span class="pl-c1"> check</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-server-s2-web2%3A8080-"><span class="pl-k"> server</span> s2 web2<span class="pl-v">:8080</span><span class="pl-c1"> check</span></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-server-s3-web3%3A8080-"><span class="pl-k"> server</span> s3 web3<span class="pl-v">:8080</span><span class="pl-c1"> check</span></td></tr></tbody></table>

</div></div></div></div></div><div class="gist-meta">[view raw](https://gist.github.com/haproxytechblog/d780483e153fd2d84f54719c94133992/raw/7c11dd62e89604bd2b8f43d7f81c79382dd5ce39/blog20210802-04.cfg)</div></div></div></div></div>A few things to note:

<div class="mx-auto prose prose-md">- In the `global` section, the `stats socket` line enables the [HAProxy Runtime API](https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api) and also [enables seamless reloads](https://www.haproxy.com/blog/hitless-reloads-with-haproxy-howto) of HAProxy.
- The first frontend listens on port 8404 and enables the [HAProxy Stats dashboard](https://www.haproxy.com/blog/exploring-the-haproxy-stats-page), which displays live statistics about your load balancer.
- The other frontend listens on port 80 and dispatches requests to one of the three web applications listed in the *webservers* backend.
- Instead of using the IP address of each web app, we’re using their hostnames *web1*, *web2*, and *web3*. You can use this type of DNS-based routing when you create a Docker bridge network as we’ve done.

</div>Next, create and run an HAProxy container and map its port 80 to the same port on the host by including the `-p` argument. Also, map port 8404 for the HAProxy Stats page:

<div class="mx-auto prose prose-md"><div class="my-8 post-gist not-prose  "><div class="gist"><div class="gist-file" data-color-mode="light" data-light-theme="light" translate="no"><div class="gist-data"><div class="js-gist-file-update-container js-task-list-container"><div class="file my-2" id="bkmrk-%24-sudo-docker-run--d-4"><div aria-label="blog20210802-05.sh content, created by haproxytechblog on 02:54PM on August 02, 2021." class="Box-body p-0 blob-wrapper data type-shell  " itemprop="text" role="region" tabindex="0"><div class="js-check-hidden-unicode js-blob-code-container blob-code-content"><table class="highlight tab-size js-file-line-container" data-hpc="" data-paste-markdown-skip="" data-tab-size="4" data-tagsearch-path="blog20210802-05.sh"><tbody><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-%24-sudo-docker-run--d-5">$ sudo docker run -d \\</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk---name-haproxy-%5C">--name haproxy \\</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk---net-mynetwork-%5C">--net mynetwork \\</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk--v-%24%28pwd%29%3A%2Fusr%2Flocal">-v <span class="pl-s"><span class="pl-pds">$(</span>pwd<span class="pl-pds">)</span></span>:/usr/local/etc/haproxy:ro \\</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk--p-80%3A80-%5C">-p 80:80 \\</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk--p-8404%3A8404-%5C">-p 8404:8404 \\</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-haproxytech%2Fhaproxy-">haproxytech/haproxy-alpine:2.4</td></tr></tbody></table>

</div></div></div></div></div><div class="gist-meta">[view raw](https://gist.github.com/haproxytechblog/d780483e153fd2d84f54719c94133992/raw/7c11dd62e89604bd2b8f43d7f81c79382dd5ce39/blog20210802-05.sh)</div></div></div></div></div>Calling `docker ps` afterwards shows that HAProxy is running:

<div class="mx-auto prose prose-md"><div class="my-8 post-gist not-prose  "><div class="gist"><div class="gist-file" data-color-mode="light" data-light-theme="light" translate="no"><div class="gist-data"><div class="js-gist-file-update-container js-task-list-container"><div class="file my-2" id="bkmrk-%24-sudo-docker-ps-con-1"><div aria-label="blog20210802-06.sh content, created by haproxytechblog on 02:54PM on August 02, 2021." class="Box-body p-0 blob-wrapper data type-shell  " itemprop="text" role="region" tabindex="0"><div class="js-check-hidden-unicode js-blob-code-container blob-code-content"><table class="highlight tab-size js-file-line-container" data-hpc="" data-paste-markdown-skip="" data-tab-size="4" data-tagsearch-path="blog20210802-06.sh"><tbody><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-%24-sudo-docker-ps-1">$ sudo docker ps</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk--7"></td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-container-id-image-c-1">CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-d734d0ef2635-haproxy">d734d0ef2635 haproxytech/haproxy-alpine:2.4 <span class="pl-s"><span class="pl-pds">"</span>/docker-entrypoint.…<span class="pl-pds">"</span></span> 3 seconds ago Up 2 seconds 0.0.0.0:80-<span class="pl-k">&gt;</span>80/tcp, 0.0.0.0:8404-<span class="pl-k">&gt;</span>8404/tcp haproxy</td></tr></tbody></table>

</div></div></div></div></div><div class="gist-meta">[view raw](https://gist.github.com/haproxytechblog/d780483e153fd2d84f54719c94133992/raw/7c11dd62e89604bd2b8f43d7f81c79382dd5ce39/blog20210802-06.sh)</div></div></div></div></div>You can access the *echo-server* web application at [http://localhost](http://localhost/). Each request to it will be load balanced by HAProxy. Also, you can see the HAProxy Stats page at [http://localhost:8404](http://localhost:8404/).

If you make a change to your haproxy.cfg file, you can reload the load balancer—without disrupting traffic—by calling the `docker kill` command:

<div class="mx-auto prose prose-md"><div class="my-8 post-gist not-prose  "><div class="gist"><div class="gist-file" data-color-mode="light" data-light-theme="light" translate="no"><div class="gist-data"><div class="js-gist-file-update-container js-task-list-container"><div class="file my-2" id="bkmrk-%24-sudo-docker-kill--"><div aria-label="blog20210802-07.sh content, created by haproxytechblog on 02:54PM on August 02, 2021." class="Box-body p-0 blob-wrapper data type-shell  " itemprop="text" role="region" tabindex="0"><div class="js-check-hidden-unicode js-blob-code-container blob-code-content"><table class="highlight tab-size js-file-line-container" data-hpc="" data-paste-markdown-skip="" data-tab-size="4" data-tagsearch-path="blog20210802-07.sh"><tbody><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-%24-sudo-docker-kill---1">$ sudo docker <span class="pl-c1">kill</span> -s HUP haproxy</td></tr></tbody></table>

</div></div></div></div></div><div class="gist-meta">[view raw](https://gist.github.com/haproxytechblog/d780483e153fd2d84f54719c94133992/raw/7c11dd62e89604bd2b8f43d7f81c79382dd5ce39/blog20210802-07.sh)</div></div></div></div></div>To delete the containers and network, run the `docker stop`, `docker rm`, and `docker network rm` commands:

<div class="mx-auto prose prose-md"><div class="my-8 post-gist not-prose  "><div class="gist"><div class="gist-file" data-color-mode="light" data-light-theme="light" translate="no"><div class="gist-data"><div class="js-gist-file-update-container js-task-list-container"><div class="file my-2" id="bkmrk-%24-sudo-docker-stop-w"><div aria-label="blog20210802-08.sh content, created by haproxytechblog on 02:54PM on August 02, 2021." class="Box-body p-0 blob-wrapper data type-shell  " itemprop="text" role="region" tabindex="0"><div class="js-check-hidden-unicode js-blob-code-container blob-code-content"><table class="highlight tab-size js-file-line-container" data-hpc="" data-paste-markdown-skip="" data-tab-size="4" data-tagsearch-path="blog20210802-08.sh"><tbody><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-%24-sudo-docker-stop-w-1">$ sudo docker stop web1 <span class="pl-k">&amp;&amp;</span> sudo docker rm web1</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-%24-sudo-docker-stop-w-2">$ sudo docker stop web2 <span class="pl-k">&amp;&amp;</span> sudo docker rm web2</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-%24-sudo-docker-stop-w-3">$ sudo docker stop web3 <span class="pl-k">&amp;&amp;</span> sudo docker rm web3</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-%24-sudo-docker-stop-h">$ sudo docker stop haproxy <span class="pl-k">&amp;&amp;</span> sudo docker rm haproxy</td></tr><tr><td class="blob-code blob-code-inner js-file-line" id="bkmrk-%24-sudo-docker-networ-2">$ sudo docker network rm mynetwork</td></tr></tbody></table>

</div></div></div></div></div><div class="gist-meta">[view raw](https://gist.github.com/haproxytechblog/d780483e153fd2d84f54719c94133992/raw/7c11dd62e89604bd2b8f43d7f81c79382dd5ce39/blog20210802-08.sh)</div></div></div></div></div>## [​#](https://www.haproxy.com/blog/how-to-run-haproxy-with-docker#conclusion)[Conclusion](https://www.haproxy.com/blog/how-to-run-haproxy-with-docker#conclusion)

In this blog post, you learned how running HAProxy inside of a Docker container can simplify its deployment and lifecycle management. Docker provides a standardized way for deploying applications, making the process repeatable and testable. While the CPU overhead of running Docker is negligible, it can incur extra network latency, but the impact of that depends on your use case and throughput needs.

To run HAProxy, simply create an HAProxy configuration file and then call the `docker run` command with the name of the HAProxy Docker image. HAProxy Technologies supplies up-to-date Docker images on Docker Hub.

Want to know when more content like this is published? [Subscribe to our blog](https://www.haproxy.com/blog/how-to-run-haproxy-with-docker) or follow us on [Twitter](https://twitter.com/haproxy). You can also join the conversation on Slack.

[<span class="pr-5 text-xl font-bold">  
<span class="block text-base">Get the latest release updates, tutorials, and deep-dives from HAProxy experts.</span></span>](https://www.haproxy.com/blog/how-to-run-haproxy-with-docker)

</main></div></div>## Authors [Nick Ramirez](https://www.haproxy.com/blog/author/nramirez)

Nick creates technical content for HAProxy Technologies ranging from documentation and blog posts to Wikipedia articles, GitHub READMEs and Stack Overflow answers. With a background in web development and DevOps, he has fun digging into product features and discovering the optimal path for a new blog tutorial.

<div class="container flex flex-row mx-auto" id="bkmrk-twitter%C2%A0linkedin%C2%A0git" style="text-align: justify;"><div class="w-auto mx-auto grow px-default"><div class="max-w-[720px] mx-auto"><div class="pb-8 my-8 border-t-2 border-b-2"><div class="space-y-8"><div class="flex flex-row flex-wrap md:flex-nowrap"><div class="md:pl-default"><div>  
</div>[Twitter](https://twitter.com/NickMRamirez " on Twitter") [LinkedIn](https://www.linkedin.com/in/nick-ramirez-1b44624 " on LinkedIn") [GitHub](https://github.com/NickMRamirez " on GitHub")</div></div></div></div><div class="my-default">  
</div></div></div></div>## Related Posts

<div class="container flex flex-row mx-auto" id="bkmrk-october-3rd%2C-2024-us" style="text-align: justify;"><div class="w-auto mx-auto grow px-default"><div class="max-w-[720px] mx-auto"><div class="my-default">  
</div><div class="grid gap-6 md:grid-cols-2" x-intersect:enter="showSidebars = false" x-intersect:leave="showSidebars = true"><article class="flex flex-col mb-10 md:mb-0 gradient-glassfill h-full component"><div class="pt-2 px-3 flex flex-col justify-between flex-1 relative"><div><time class="mb-1 body-sm" datetime="2024-10-03">October 3rd, 2024</time></div></div>#### [Use the GeoIP Database With HAProxy (Easy to Follow Guide)](https://www.haproxy.com/blog/use-geoip-database-within-haproxy)

Geolocation is the process of linking a third party to a geographical location. In easier words: know the country of a client's IP address. On the Internet, such a base is called GeoIP.

<div class=" relative">[<picture class="w-full  "><source media="(min-width: 1024px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/8be0827ef533db8a1dca774cc130075f/haproxy-blog.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/5de84e83c327c630d92d803c3c5078ad/haproxy-blog.png 2x"><source media="(min-width: 768px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/00c8b488abd16c431e13ffc5aea24430/haproxy-blog.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/5ff345d9d03413871a289d8b66471868/haproxy-blog.png 2x"><source media="(min-width: 480px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/c34724227bd4dbc6f0c1d6de6825dae5/haproxy-blog.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/f335af686c6e29e6d786661fd157a5da/haproxy-blog.png 2x"><source media="(max-width: 479px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/5f0fdd82d968298f24728579360f9af1/haproxy-blog.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/912e49efffa864fcbfc1dd5b148bfc0c/haproxy-blog.png 2x"></source></source></source></source></picture>](https://www.haproxy.com/blog/use-geoip-database-within-haproxy)</div></article><article class="flex flex-col mb-10 md:mb-0 gradient-glassfill h-full component"><div class="pt-2 px-3 flex flex-col justify-between flex-1 relative"><div><time class="mb-1 body-sm" datetime="2023-12-13">December 13th, 2023</time></div></div>#### [Hitless Reloads With HAProxy (How-To Configuration Guide)](https://www.haproxy.com/blog/hitless-reloads-with-haproxy-howto)

HAProxy offers a patch set for enabling seamless reloads of HAProxy without dropping packets in the process. In this blog post, we show you how to enable this.

<div class=" relative">[<picture class="w-full  "><source media="(min-width: 1024px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/8be0827ef533db8a1dca774cc130075f/haproxy-blog.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/5de84e83c327c630d92d803c3c5078ad/haproxy-blog.png 2x"><source media="(min-width: 768px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/00c8b488abd16c431e13ffc5aea24430/haproxy-blog.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/5ff345d9d03413871a289d8b66471868/haproxy-blog.png 2x"><source media="(min-width: 480px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/c34724227bd4dbc6f0c1d6de6825dae5/haproxy-blog.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/f335af686c6e29e6d786661fd157a5da/haproxy-blog.png 2x"><source media="(max-width: 479px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/5f0fdd82d968298f24728579360f9af1/haproxy-blog.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/912e49efffa864fcbfc1dd5b148bfc0c/haproxy-blog.png 2x"></source></source></source></source></picture>](https://www.haproxy.com/blog/hitless-reloads-with-haproxy-howto)</div></article><article class="flex flex-col mb-10 md:mb-0 gradient-glassfill h-full component"><div class="pt-2 px-3 flex flex-col justify-between flex-1 relative"><div><time class="mb-1 body-sm" datetime="2024-09-10">September 10th, 2024</time></div></div>#### [HAProxy on Docker Swarm: load balancing &amp; DNS service discovery](https://www.haproxy.com/blog/haproxy-on-docker-swarm-load-balancing-and-dns-service-discovery)

In this blog post, you’ll see how to combine HAProxy and Docker Swarm to load balance traffic across your service replicas.

<div class=" relative">[<picture class="w-full  "><source media="(min-width: 1024px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxydockerswarm.png/63ed58d9b06dc70fb69cf3527801b5e6/haproxydockerswarm.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxydockerswarm.png/f5c09d59fcc6f4214ddc05a53083d356/haproxydockerswarm.png 2x"><source media="(min-width: 768px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxydockerswarm.png/976d7d4c2379406b0bf4e0864de62c43/haproxydockerswarm.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxydockerswarm.png/8c21c6051bedb582578bbefae1c448aa/haproxydockerswarm.png 2x"><source media="(min-width: 480px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxydockerswarm.png/f9c79df77b21cde27b0211c7304c4d7e/haproxydockerswarm.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxydockerswarm.png/34ce154a8e36c29a04427b92395848c9/haproxydockerswarm.png 2x"><source media="(max-width: 479px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxydockerswarm.png/79fd611c002fe7646cb7557253074ca2/haproxydockerswarm.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxydockerswarm.png/10f7fd57b40eb81b29b62dc1d723f815/haproxydockerswarm.png 2x"></source></source></source></source></picture>](https://www.haproxy.com/blog/haproxy-on-docker-swarm-load-balancing-and-dns-service-discovery)</div></article><article class="flex flex-col mb-10 md:mb-0 gradient-glassfill h-full component"><div class="pt-2 px-3 flex flex-col justify-between flex-1 relative"><div><time class="mb-1 body-sm" datetime="2025-08-01">August 1st, 2025</time></div></div>#### [How to Check &amp; Test Your HAProxy Config Safely (Easy Guide)](https://www.haproxy.com/blog/testing-your-haproxy-configuration)

Learn how to safely test and validate your HAProxy config file with a single command.

<div class=" relative">[<picture class="w-full  "><source media="(min-width: 1024px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png/6564ed4a6f40a008c0b97a4f6811e65e/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png/225018ec855b3cbe6cb49e879b515a08/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png 2x"><source media="(min-width: 768px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png/b54b5a76a7d4d8cc858389fcb5778d37/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png/88bc277356675984432991ce1aa61b68/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png 2x"><source media="(min-width: 480px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png/0515e58f6ad2c6c89bbb2878cd0ae2d8/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png/05b1dfadb11a98a6932ea8f8d988ee77/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png 2x"><source media="(max-width: 479px)" srcset="https://cdn.haproxy.com/img/containers/partner_integrations/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png/e7b31f0d3aea06031d308ccfccb38718/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png 1x, https://cdn.haproxy.com/img/containers/partner_integrations/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png/fecc1d6064d44eee41ecff99f04d4efb/haproxy_basics_-_how_to_validate_your_haproxy_configuration.png 2x"></source></source></source></source></picture>](https://www.haproxy.com/blog/testing-your-haproxy-configuration)</div></article></div></div></div></div>