Complete HAProxy keyboard shortcuts and commands reference — 10 shortcuts across 2 categories. Quick reference cheat sheet for Windows & Mac.
HAProxy is configured by a file and controlled at runtime through a Unix socket, and this page lists both halves: the process commands for starting, validating and reloading, and the runtime API calls that change server state without a reload. The socket commands are written with socat because that is how the documentation shows them; the notes explain what each does in an outage.
| Shortcut | Action |
|---|---|
| haproxy -f /etc/haproxy/haproxy.cfg | Start with config |
| haproxy -c -f /etc/haproxy/haproxy.cfg | Validate config |
| systemctl reload haproxy | Graceful reload |
| systemctl restart haproxy | Restart |
| haproxy -f haproxy.cfg -p haproxy.pid -D | Daemon mode |
| Shortcut | Action |
|---|---|
| echo "show info" | socat stdio /var/run/haproxy.sock | Show info |
| echo "show stat" | socat stdio /var/run/haproxy.sock | Show stats |
| echo "show servers state" | socat stdio /var/run/haproxy.sock | Server state |
| echo "disable server backend/server1" | socat stdio /var/run/haproxy.sock | Disable server |
| echo "enable server backend/server1" | socat stdio /var/run/haproxy.sock | Enable server |
The most essential HAProxy shortcuts are: haproxy -f /etc/haproxy/haproxy.cfg (Start with config), haproxy -c -f /etc/haproxy/haproxy.cfg (Validate config), systemctl reload haproxy (Graceful reload).
The HAProxy shortcut for start with config is haproxy -f /etc/haproxy/haproxy.cfg.
Yes — use My Stack to combine HAProxy shortcuts with any other platform on this site into one printable reference, which is useful if your daily workflow spans several tools.
haproxy -c -f /etc/haproxy/haproxy.cfg parses the configuration and reports errors and warnings without starting anything, and it belongs in front of every reload — a reload with a broken file fails and leaves the old process running, but the error is easier to read from the validator. systemctl reload haproxy then performs a graceful reload: a new process binds the sockets, the old one finishes its connections and exits, and no request is dropped. systemctl restart haproxy drops connections and is only for changes a reload cannot apply. haproxy -f /etc/haproxy/haproxy.cfg runs in the foreground for debugging, and haproxy -f haproxy.cfg -p haproxy.pid -D daemonises with a PID file when systemd is not in charge.
With stats socket enabled in the global section, echo "show info" | socat stdio /var/run/haproxy.sock prints process-level counters — connections, uptime, limits — and echo "show stat" | socat stdio /var/run/haproxy.sock returns per-frontend, backend and server statistics as CSV, which is the same data the stats page shows and is easier to grep. echo "show servers state" | socat stdio /var/run/haproxy.sock lists every server with its admin and operational state, weights and check results, the first command to run when a backend is marked down.
echo "disable server backend/server1" | socat stdio /var/run/haproxy.sock sets a server to maintenance: new connections stop going to it while existing ones complete, which is how you deploy to one node at a time. echo "enable server backend/server1" | socat stdio /var/run/haproxy.sock brings it back. Runtime changes are lost on restart unless the state is saved with show servers state to the file named by server-state-file, so make the change permanent in the configuration if it should survive.
Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"