OpenClaw Docker install Homebrew

How to Fix “Brew Not Found” Errors in OpenClaw Docker Containers

Working with the Docker container for OpenClaw isn’t the best. We created a single-line Docker exec command to install Homebrew into a running Docker OpenClaw container.

If you are running OpenClaw via Docker, you may have encountered a frustrating roadblock when trying to install specific skills (such as openai-whisper or yt-dlp). The error is straightforward but disruptive: the system attempts to call brew, but fails because Homebrew is not installed in the standard OpenClaw Docker image.

In this guide, we’ll explain why this happens and provide a one-line fix to get your container running with full dependency support.

Why isn’t Homebrew included in the OpenClaw Docker Image?

At first glance, it seems logical for the devs to include Homebrew (or Linuxbrew) pre-installed, especially since many OpenClaw skills rely on it to manage external binaries and dependencies. However, there are two primary reasons why the official image remains “lean”:

  1. Image Size & Optimisation: Docker best practices dictate that images should be as small and lightweight as possible. Including Homebrew—and the entire dependency tree it brings with it—would significantly increase the image size, leading to slower pull times and higher storage costs.
  2. Security & Layering: Standardising on a minimal base allows for a more secure environment. By not including a package manager by default, the attack surface is reduced. Developers can then layer only the specific tools they need onto the container.

The problem arises when you attempt to install a “Skill” within the running container that expects brew to be present in the $PATH. Because the container is isolated, it cannot access your host machine’s Homebrew installation.

The Solution: The One-Line Fix

You don’t need to rebuild your entire Dockerfile or manually navigate complex installation steps. You can inject Homebrew into your existing OpenClaw container using a single command.

Run the following script inside your terminal – GitBash, CMD or Console to automate the installation
Changing $YourContainerID with your own container ID:

docker exec -it -u root $YourContainerID bash -c 'mkdir -p /home/linuxbrew/.linuxbrew && curl -L https://github.com/Homebrew/brew/tarball/main | tar xz --strip-components 1 -C /home/linuxbrew/.linuxbrew && useradd -m -s /bin/bash brewuser && echo '"'"'brewuser:brewpass'"'"' | chpasswd && chown -R brewuser:brewuser /home/linuxbrew && printf '"'"'#!/bin/bash\necho brewpass | su - brewuser -c "/home/linuxbrew/.linuxbrew/bin/brew $*"\n'"'"' > /usr/bin/brew && chmod +x /usr/bin/brew && echo '"'"'export PATH="/usr/bin:$PATH"'"'"' >> ~/.bashrc && echo '"'"'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"'"'"' >> ~/.bashrc && source ~/.bashrc'

Note: Please note that this command creates directories and needs to be run as root to create a brew user and set permissions

What does the code do?

Never run a script you don’t understand. This is what the script does:

  1. mkdir – Creates the directory needed for Linux Brew /home/linuxbrew/.linuxbrew
  2. curl – downloads the tarball from the official Homebrew GitHub project and extracts it into the /home/linuxbrew/.linuxbrew directory
  3. useradd – adds a brewuser with the password brewpassword (you can change this if you want)
  4. chown – takes control of the linuxbrew directory for the user brewuser
  5. printf – generates a proxy script that passes a command sent to /usr/bin/brew and forwards it to /home/linuxbrew/.linuxbrew/bin/brew as a standard user, maintaining Homebrew needs to run as a standard user.
  6. chmod – makes the /usr/bin/brew folder executable
  7. echo – adds the brew path to the PATH environment variable, so it can be called from the terminal, by adding it to the .bashrc file.

Verification

Once the script has finished executing, verify that the installation was successful by checking the version of brew (Replacing $YourContainerID with your container ID):

docker exec -it -u node $YourContainerID bash -c 'brew --version'

If you see a version number returned, you are ready to go! You can now proceed with installing your required OpenClaw skills without encountering “command not found” errors.

This prevents you from having to deal with constant patches, patching the constantly changing OpenClaw Docker installer script, or dealing with Custom Docker Images where you don’t know what is installed in the background. You can build from source with the official OpenClaw git repository.

You could also do what I have done and build a script that downloads the official repository, builds OpenClaw and installs Homebrew in one go. Here is the script if you need it:

OpenClaw with Homebrew Pre-Installed with a Single Script:

Create a folder you wish to build from, e.g. C:/Docker/OpenClaw if using Docker Desktop for Windows. Create a new text file and copy the script below, save it naming it installer.sh (Needs to be run with GitBash if you are on Windows)

folder="my-openclaw"
export OPENCLAW_GATEWAY_PORT=18789
export OPENCLAW_BRIDGE_PORT=18790
saveDirectory="config"
export OPENCLAW_IMAGE_VERSION="2026.4.22"

export OPENCLAW_IMAGE="ghcr.io/openclaw/openclaw:${OPENCLAW_IMAGE_VERSION}"
export OPENCLAW_HOME_VOLUME="home_data"
export OPENCLAW_CONFIG_DIR="./../${saveDirectory}/.openclaw/"
export OPENCLAW_WORKSPACE_DIR="${OPENCLAW_CONFIG_DIR}/workspace/"
export OPENCLAW_DOCKER_APT_PACKAGES="jq"
export OPENCLAW_LINUXBREW_DIR="${OPENCLAW_CONFIG_DIR}/linuxbrew/"

#export OPENCLAW_EXTRA_MOUNTS="${OPENCLAW_LINUXBREW_DIR}:/home/linuxbrew/,${OPENCLAW_CONFIG_DIR}/.config:/home/.config/"
export DOCKER_CLI_HINTS=false

## clean up old install
read -p "Would you like to clean the old install? [y/n]: " confirm
if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] ; then
	if [ -d "./${folder}/" ] ; then
		echo "Removing Git Folder.."
		rm -r -f "./${folder}/";
	fi	
	if [ -d "./${saveDirectory}/.openclaw/linuxbrew/.linuxbrew/var/homebrew/tmp/" ]; then
		echo "Temp LinuxBrew Directory found.. Removing files.."
		rm -r -f "./${saveDirectory}/.openclaw/linuxbrew/.linuxbrew/var/homebrew/tmp/"
	fi
fi
if [ ! -d "./${folder}/" ]; then
	# pull from git
	if [ OPENCLAW_IMAGE_VERSION == "latest" ] ; then
		git clone https://github.com/openclaw/openclaw.git $folder
	else
		git clone -b v${OPENCLAW_IMAGE_VERSION} --single-branch https://github.com/openclaw/openclaw.git $folder
	fi
fi
## would you like to skip onboarding?
read -p "Would you like to skip onboarding? [y/n]: " confirm
if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] ; then
	export OPENCLAW_SKIP_ONBOARDING="1"
else
	export OPENCLAW_SKIP_ONBOARDING="0"
fi
## now run the script
echo "Running main installer script.."
./$folder/scripts/docker/setup.sh
read -p "Would you like to install Linux Brew? [y/n]: " confirm
if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] ; then
	docker exec -it -u root $(docker ps -a --filter name=$folder --format '{{ .Names }}' | grep $folder) bash -c 'mkdir -p /home/linuxbrew/.linuxbrew && curl -L https://github.com/Homebrew/brew/tarball/main | tar xz --strip-components 1 -C /home/linuxbrew/.linuxbrew && useradd -m -s /bin/bash brewuser && echo '"'"'brewuser:brewpass'"'"' | chpasswd && chown -R brewuser:brewuser /home/linuxbrew && printf '"'"'#!/bin/bash\necho brewpass | su - brewuser -c "/home/linuxbrew/.linuxbrew/bin/brew $*"\n'"'"' > /usr/bin/brew && chmod +x /usr/bin/brew && echo '"'"'export PATH="/usr/bin:$PATH"'"'"' >> ~/.bashrc && echo '"'"'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"'"'"' >> ~/.bashrc && source ~/.bashrc'
	read -p "Would you like to install OpenAI Whisper? [y/n]: " confirm
	if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] ; then
		docker exec -it -u root $(docker ps -a --filter name=$folder --format '{{ .Names }}' | grep $folder) bash -c 'brew install openai-whisper'
	fi
fi
read -p "Would you like to install Himalaya? [y/n]: " confirm
if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] ; then
	docker exec -it -u root $(docker ps -a --filter name=$folder --format '{{ .Names }}' | grep $folder) bash -c 'curl -sSL https://raw.githubusercontent.com/pimalaya/himalaya/master/install.sh | sh'
fi
export CLAWDOCK_DIR="${$folder}"

All you need to change is the folder name to change the Docker stack name:

folder="my-openclaw"

If you are running more than one container, you will want to change the ports. Remember to leave 100 port spacing between each container to prevent collision:

export OPENCLAW_GATEWAY_PORT=18789 
export OPENCLAW_BRIDGE_PORT=18790

To choose which version you want to install, enter the date of the Tag version. This will pull the git branch for the compose builder script and also use the corresponding git image to skip the local build process:

export OPENCLAW_IMAGE_VERSION="2026.4.22"

Note: Version 2026.4.22 is the latest stable version as of 01-05-2026

Hopefully, Homebrew will be easier to install manually from the terminal or the Web Interface in future releases, without having to proxy.

Thanks, Peter Steinberger and the OpenClaw contributors, for developing such great software.

GitHub Scripts:

You can download the scripts from the following repository:

https://github.com/digitalassassins/OpenClawDockerHomebrewInstaller/