Troubleshooting OpenClaw Skill Installation: Homebrew Configuration Guide for Zeabur (Docker)
1. The Problem
When running OpenClaw on Zeabur (or similar containerized environments), the system defaults to the root user. When you attempt to install skills that require external dependencies (like GitHub, FFmpeg, or yt-dlp), OpenClaw triggers Homebrew (brew).
However, Homebrew strictly prohibits running as root for security reasons, resulting in the following error:
Error: Running Homebrew as root is extremely dangerous and no longer supported.
This blocks the automated skill installation process, preventing the download of necessary binary components.
2. The Resolution (Step-by-Step)
The solution involves deploying a manual Homebrew instance, creating a non-privileged user, and setting up a command wrapper to trick the system into running brew under a safe context.
Step 1: Install Homebrew (Manual Untar Method)
Since the official curl script forces a root check, we bypass it by manually downloading and extracting the Brew core into /home/linuxbrew:
bash
# Create directory and extract Homebrew (Alternative to the official curl install)
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/main | tar xz --strip-components 1 -C homebrew
請謹慎使用程式碼。
Step 2: Create a Non-Privileged User & Grant Rights
We create a virtual user named brewuser specifically to handle the downloading and compiling tasks of Homebrew:
bash
# 1. Create the user
useradd -m -s /bin/bash brewuser
# 2. Transfer ownership of the Homebrew directory to this user
chown -R brewuser:brewuser /home/linuxbrew
請謹慎使用程式碼。
Step 3: Create a Command Wrapper (Bin Wrapper)
This is the core fix. We create a "proxy" brew command in the system path. When OpenClaw calls brew, it actually triggers a su (switch user) command to execute the real brew as brewuser.
bash
# Create the proxy script
cat <<'EOF' > /usr/bin/brew
#!/bin/bash
# Pass all arguments to the real brew via brewuser
su - brewuser -c "/home/linuxbrew/.linuxbrew/bin/brew $*"
EOF
# Grant execution permissions
chmod +x /usr/bin/brew
請謹慎使用程式碼。
Step 4: Persistent Environment Update (~/.bashrc)
To ensure the proxy script is prioritized and available across all sessions (even after a container restart), update the root .bashrc:
bash
# Prioritize /usr/bin in PATH and load brew environment
echo 'export PATH="/usr/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
source ~/.bashrc
請謹慎使用程式碼。
3. Verification & Use
After completing the steps, verify the setup:
- Run
which brew: It should return/usr/bin/brew. - Run
brew --version: It should display version info without the root error. - Install Skills: You can now proceed with OpenClaw skill installations (e.g., GitHub integration):