Windows users: All commands below should be run inside the WSL terminal (Ubuntu). Use wsl -d Ubuntu in PowerShell or search “Ubuntu” in the Start menu to access the Ubuntu terminal. We also have a step-by-step video tutorial available.
Requires Python 3.12+ and uv installed.Install OpenHands:
Copy
Ask AI
uv tool install openhands --python 3.12
Run OpenHands:
Copy
Ask AI
openhands
Upgrade OpenHands:
Copy
Ask AI
uv tool upgrade openhands --python 3.12
Install the OpenHands CLI binary with the install script:
Copy
Ask AI
curl -fsSL https://install.openhands.dev/install.sh | sh
Then run:
Copy
Ask AI
openhands
Your system may require you to allow permissions to run the executable.
MacOS
When running the OpenHands CLI on Mac, you may get a warning that says “openhands can’t be opened because Apple
cannot check it for malicious software.”
Open System Settings.
Go to Privacy & Security.
Scroll down to Security and click Allow Anyway.
Rerun the OpenHands CLI.
Set the following environment variable in your terminal:
The -e SANDBOX_USER_ID=$(id -u) is passed to the Docker command to ensure the sandbox user matches the host user’s
permissions. This prevents the agent from creating root-owned files in the mounted workspace.
The first time you run the CLI, it will take you through configuring the required LLM settings. These will be saved
for future sessions in ~/.openhands/settings.json.The conversation history will be saved in ~/.openhands/conversations.
If you’re upgrading from a CLI version before release 1.0.0, you’ll need to redo your settings setup as the
configuration format has changed.