The error message “bash: socat: command not found” surfaces in Linux terminal sessions when systems engineers attempt to establish bidirectional data relays, proxy Unix domain sockets, or bridge network ports on lightweight server templates, stripped-down cloud images, or minimal container environments. The socat (SOcket CAT) utility is not bundled within default minimal operating system installations to keep base image footprints compact.
Install socat on Debian, Ubuntu, and Linux Mint
On Debian-based distributions, socat is maintained in the core universe repository:
- Update your local APT repository index:
sudo apt update - Install the socat package:
sudo apt install -y socat - Verify the binary path and version:
which socat socat -V
Install socat on RHEL, CentOS, Rocky Linux, and Fedora
On enterprise Red Hat derivatives, socat is provided through standard system package streams or the EPEL repository:
- On Fedora, RHEL 8/9, Rocky Linux, and AlmaLinux:
sudo dnf install -y socat - If running RHEL or CentOS where the package is unavailable, enable the Extra Packages for Enterprise Linux (EPEL) repository first:
sudo dnf install -y epel-release sudo dnf install -y socat - On legacy CentOS 7 systems:
sudo yum install -y socat
Install socat in Alpine Linux Docker Containers
Alpine Linux container images exclude networking relays by default to reduce image attack surface:
- Update the Alpine package index:
apk update - Install the socat package:
apk add socat - In automated Dockerfile build manifests, include the package during the provisioning layer:
RUN apk add --no-cache socat
Install socat on Arch Linux and Manjaro
Arch Linux includes socat within the primary extra repository:
- Synchronise the package database and install via Pacman:
sudo pacman -Sy socat - Confirm operational execution by running a simple loopback port relay test:
socat TCP4-LISTEN:8080,fork TCP4:127.0.0.1:80
Installing the socat package restores versatile multi-protocol socket forwarding, serial port debugging, and network proxying capabilities across minimal Linux installations.