
Automated, hardened installation of OpenClaw with Docker and Tailscale VPN support for Debian/Ubuntu Linux.
Effective 2026-02-06, support for bare-metal macOS installations has been removed from this playbook.
The underlying project currently requires system-level permissions and configurations that introduce significant security risks when executed on a primary host OS. To protect user data and system integrity, we have disabled bare-metal execution.
Darwin (macOS) system.pnpm install -g openclaw@latestInstall the latest stable version from npm:
curl -fsSL https://raw.githubusercontent.com/openclaw/openclaw-ansible/main/install.sh | bash
Install from source for development or testing:
# Clone the installer
git clone https://github.com/openclaw/openclaw-ansible.git
cd openclaw-ansible
# Install in development mode
./run-playbook.sh -e openclaw_install_mode=development
After installation completes, switch to the openclaw user:
sudo su - openclaw
Then run the quick-start onboarding wizard:
openclaw onboard --install-daemon
This will:
After onboarding, run the post-install security verification. The checks confirm that the firewall and SSH protection are active, Docker-published ports remain externally blocked, and OpenClaw only listens on localhost.
# Configure manually
openclaw configure
# Login to provider
openclaw providers login
# Test gateway
openclaw gateway
# Install as daemon
openclaw daemon install
openclaw daemon start
# Check status
openclaw status
openclaw logs
# Install dependencies
sudo apt update && sudo apt install -y ansible git
# Clone repository
git clone https://github.com/openclaw/openclaw-ansible.git
cd openclaw-ansible
# Install Ansible collections
ansible-galaxy collection install -r requirements.yml
# Run installation
./run-playbook.sh
Build from source for development:
# Same as above, but with development mode flag
./run-playbook.sh -e openclaw_install_mode=development
# Or directly:
ansible-playbook playbook.yml --ask-become-pass -e openclaw_install_mode=development
This will:
~/code/openclawpnpm install and pnpm build~/.local/bin/openclaw.bashrcopenclaw.installer is an Ansible collection and can be installed with the ansible-galaxy command:
ansible-galaxy collection install git+https://github.com/openclaw/openclaw-ansible.git
Alternatively, add it to the requirements.yml file of your Ansible project as follows:
collections:
- name: https://github.com/openclaw/openclaw-ansible.git
type: git
version: main
As a version, you can use a branch, a version tag (e.g., v2.0.0), or a specific commit hash.
First copy the sample inventory to inventory.yml.
cp inventory-sample.yml inventory.yml
Second edit the inventory file to match your cluster setup. For example:
openclaw_servers:
children:
server:
hosts:
192.16.35.11:
192.16.35.12:
If needed, you can also edit vars section to match your environment.
Start provisioning of the server using one of the following commands. The command to be used depends on whether you installed openclaw.installer with ansible-galaxy or if you run the playbook from within the cloned git repository:
Installed with ansible-galaxy
ansible-playbook openclaw.installer.deploy -i inventory.yml
In your existing playbook
- name: Deploy OpenClaw
hosts: my_servers
become: true
roles:
- openclaw.installer.openclaw
Running the playbook from inside the repository
ansible-playbook playbooks/deploy.yml -i inventory.yml
Alternatively, to run the playbook from your existing project setup, run the playbook from within your own playbook:
Installed with ansible-galaxy
- name: Deploy OpenClaw
ansible.builtin.import_playbook: openclaw.installer.deploy
Running the playbook from inside the repository
- name: Deploy OpenClaw
ansible.builtin.import_playbook: playbooks/deploy.yml
pnpm install -g openclaw@latestpnpm install -g openclaw@latesthttps://github.com/openclaw/openclaw.gitpnpm build~/.local/bin/openclawopenclaw-rebuild - Rebuild after code changesopenclaw-dev - Navigate to repo directoryopenclaw-pull - Pull, install deps, and rebuildEnable with: -e openclaw_install_mode=development
docker groupRun the post-install security verification for commands and expected results. In the default configuration, an external TCP scan should show only SSH on port 22; Tailscale uses UDP and is not included in that TCP scan.
For high-security environments, audit before running:
git clone https://github.com/openclaw/openclaw-ansible.git
cd openclaw-ansible
# Review playbook.yml and roles/
ansible-playbook playbook.yml --check --diff # Dry run
ansible-playbook playbook.yml --ask-become-pass
All configuration variables can be found in roles/openclaw/defaults/main.yml.
You can override them in three ways:
ansible-playbook playbook.yml --ask-become-pass \
-e openclaw_install_mode=development \
-e "openclaw_ssh_keys=['ssh-ed25519 AAAAC3... user@host']"
# Create vars.yml
cat > vars.yml << EOF
openclaw_install_mode: development
openclaw_ssh_keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGxxxxxxxx user@host"
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAB... user@host"
openclaw_repo_url: "https://github.com/YOUR_USERNAME/openclaw.git"
openclaw_repo_branch: "feature-branch"
tailscale_authkey: "tskey-auth-xxxxxxxxxxxxx"
EOF
# Use it
ansible-playbook playbook.yml --ask-become-pass -e @vars.yml
Edit roles/openclaw/defaults/main.yml before running the playbook.
| Variable | Default | Description |
|---|---|---|
openclaw_user | openclaw | System user name |
openclaw_home | /home/openclaw | User home directory |
openclaw_install_mode | release | release or development |
openclaw_ssh_keys | [] | List of SSH public keys |
openclaw_repo_url | https://github.com/openclaw/openclaw.git | Git repository (dev mode) |
openclaw_repo_branch | main | Git branch (dev mode) |
tailscale_authkey | "" | Tailscale auth key for auto-connect |
nodejs_version | 22.x | Node.js version to install |
See roles/openclaw/defaults/main.yml for the complete list.
ansible-playbook playbook.yml --ask-become-pass \
-e "openclaw_ssh_keys=['ssh-ed25519 AAAAC3... user@host']"
ansible-playbook playbook.yml --ask-become-pass \
-e openclaw_install_mode=development \
-e openclaw_repo_url=https://github.com/YOUR_USERNAME/openclaw.git \
-e openclaw_repo_branch=feature-branch
ansible-playbook playbook.yml --ask-become-pass \
-e tailscale_authkey=tskey-auth-xxxxxxxxxxxxx
MIT - see LICENSE
Shell
72.2%
Jinja
27.8%

Automated, hardened installation of OpenClaw with Docker and Tailscale VPN support for Debian/Ubuntu Linux.
Effective 2026-02-06, support for bare-metal macOS installations has been removed from this playbook.
The underlying project currently requires system-level permissions and configurations that introduce significant security risks when executed on a primary host OS. To protect user data and system integrity, we have disabled bare-metal execution.
Darwin (macOS) system.pnpm install -g openclaw@latestInstall the latest stable version from npm:
curl -fsSL https://raw.githubusercontent.com/openclaw/openclaw-ansible/main/install.sh | bash
Install from source for development or testing:
# Clone the installer
git clone https://github.com/openclaw/openclaw-ansible.git
cd openclaw-ansible
# Install in development mode
./run-playbook.sh -e openclaw_install_mode=development
After installation completes, switch to the openclaw user:
sudo su - openclaw
Then run the quick-start onboarding wizard:
openclaw onboard --install-daemon
This will:
After onboarding, run the post-install security verification. The checks confirm that the firewall and SSH protection are active, Docker-published ports remain externally blocked, and OpenClaw only listens on localhost.
# Configure manually
openclaw configure
# Login to provider
openclaw providers login
# Test gateway
openclaw gateway
# Install as daemon
openclaw daemon install
openclaw daemon start
# Check status
openclaw status
openclaw logs
# Install dependencies
sudo apt update && sudo apt install -y ansible git
# Clone repository
git clone https://github.com/openclaw/openclaw-ansible.git
cd openclaw-ansible
# Install Ansible collections
ansible-galaxy collection install -r requirements.yml
# Run installation
./run-playbook.sh
Build from source for development:
# Same as above, but with development mode flag
./run-playbook.sh -e openclaw_install_mode=development
# Or directly:
ansible-playbook playbook.yml --ask-become-pass -e openclaw_install_mode=development
This will:
~/code/openclawpnpm install and pnpm build~/.local/bin/openclaw.bashrcopenclaw.installer is an Ansible collection and can be installed with the ansible-galaxy command:
ansible-galaxy collection install git+https://github.com/openclaw/openclaw-ansible.git
Alternatively, add it to the requirements.yml file of your Ansible project as follows:
collections:
- name: https://github.com/openclaw/openclaw-ansible.git
type: git
version: main
As a version, you can use a branch, a version tag (e.g., v2.0.0), or a specific commit hash.
First copy the sample inventory to inventory.yml.
cp inventory-sample.yml inventory.yml
Second edit the inventory file to match your cluster setup. For example:
openclaw_servers:
children:
server:
hosts:
192.16.35.11:
192.16.35.12:
If needed, you can also edit vars section to match your environment.
Start provisioning of the server using one of the following commands. The command to be used depends on whether you installed openclaw.installer with ansible-galaxy or if you run the playbook from within the cloned git repository:
Installed with ansible-galaxy
ansible-playbook openclaw.installer.deploy -i inventory.yml
In your existing playbook
- name: Deploy OpenClaw
hosts: my_servers
become: true
roles:
- openclaw.installer.openclaw
Running the playbook from inside the repository
ansible-playbook playbooks/deploy.yml -i inventory.yml
Alternatively, to run the playbook from your existing project setup, run the playbook from within your own playbook:
Installed with ansible-galaxy
- name: Deploy OpenClaw
ansible.builtin.import_playbook: openclaw.installer.deploy
Running the playbook from inside the repository
- name: Deploy OpenClaw
ansible.builtin.import_playbook: playbooks/deploy.yml
pnpm install -g openclaw@latestpnpm install -g openclaw@latesthttps://github.com/openclaw/openclaw.gitpnpm build~/.local/bin/openclawopenclaw-rebuild - Rebuild after code changesopenclaw-dev - Navigate to repo directoryopenclaw-pull - Pull, install deps, and rebuildEnable with: -e openclaw_install_mode=development
docker groupRun the post-install security verification for commands and expected results. In the default configuration, an external TCP scan should show only SSH on port 22; Tailscale uses UDP and is not included in that TCP scan.
For high-security environments, audit before running:
git clone https://github.com/openclaw/openclaw-ansible.git
cd openclaw-ansible
# Review playbook.yml and roles/
ansible-playbook playbook.yml --check --diff # Dry run
ansible-playbook playbook.yml --ask-become-pass
All configuration variables can be found in roles/openclaw/defaults/main.yml.
You can override them in three ways:
ansible-playbook playbook.yml --ask-become-pass \
-e openclaw_install_mode=development \
-e "openclaw_ssh_keys=['ssh-ed25519 AAAAC3... user@host']"
# Create vars.yml
cat > vars.yml << EOF
openclaw_install_mode: development
openclaw_ssh_keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGxxxxxxxx user@host"
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAB... user@host"
openclaw_repo_url: "https://github.com/YOUR_USERNAME/openclaw.git"
openclaw_repo_branch: "feature-branch"
tailscale_authkey: "tskey-auth-xxxxxxxxxxxxx"
EOF
# Use it
ansible-playbook playbook.yml --ask-become-pass -e @vars.yml
Edit roles/openclaw/defaults/main.yml before running the playbook.
| Variable | Default | Description |
|---|---|---|
openclaw_user | openclaw | System user name |
openclaw_home | /home/openclaw | User home directory |
openclaw_install_mode | release | release or development |
openclaw_ssh_keys | [] | List of SSH public keys |
openclaw_repo_url | https://github.com/openclaw/openclaw.git | Git repository (dev mode) |
openclaw_repo_branch | main | Git branch (dev mode) |
tailscale_authkey | "" | Tailscale auth key for auto-connect |
nodejs_version | 22.x | Node.js version to install |
See roles/openclaw/defaults/main.yml for the complete list.
ansible-playbook playbook.yml --ask-become-pass \
-e "openclaw_ssh_keys=['ssh-ed25519 AAAAC3... user@host']"
ansible-playbook playbook.yml --ask-become-pass \
-e openclaw_install_mode=development \
-e openclaw_repo_url=https://github.com/YOUR_USERNAME/openclaw.git \
-e openclaw_repo_branch=feature-branch
ansible-playbook playbook.yml --ask-become-pass \
-e tailscale_authkey=tskey-auth-xxxxxxxxxxxxx
MIT - see LICENSE
Shell
72.2%
Jinja
27.8%