Deployment Overview of OpenClaw on Server¶
Prerequisites and Basic Requirements¶
The deployment process requires an operating system compatible with Ubuntu to execute the installation scripts and manage system packages. The following conditions must be met before initiating the installation:
-
The server must be running Ubuntu.
-
Root or sudo privileges are required to install system packages, clone repositories, and modify user configurations.
-
The system must have network access to clone the OpenClaw repository from GitHub.
-
The
ansibleandgitpackages must be installed or available for installation viaapt.
Application Installation Process¶
The OpenClaw application is deployed by cloning a specific repository and executing an automated installation script. The process ensures the environment is prepared, dependencies are met, and the application is installed from the main branch.
The installation workflow includes the following steps:
-
Install system packages including
ansibleandgit. -
Remove any existing OpenClaw repository at
/opt/openclaw-ansibleto ensure a clean state. -
Clone the OpenClaw repository from
https://github.com/openclaw/openclaw-ansible.gitinto/opt/openclaw-ansibleusing themainbranch. -
Install required Ansible collections using
ansible-galaxy. -
Execute the installation script
./run-playbook.shlocated in the installation directory. -
The installation script runs with specific environment variables to manage memory and logging:
-
NODE_OPTIONS:--max-old-space-size=768 -
npm_config_jobs:2 -
npm_config_loglevel:warn -
CI:true
Permission Settings and Access Rights¶
The deployment creates a dedicated system user to manage the application and ensures appropriate ownership of directories.
-
A system user named
openclawis created with the following attributes: -
Home directory:
/home/openclaw -
Shell:
/bin/bash -
Groups:
sudo -
Password: Set to a hashed value corresponding to
openclaw -
Ownership of the
/home/openclawdirectory and all its contents is recursively assigned to theopenclawuser and group. -
The installation script
./run-playbook.shis granted execute permissions for the user.
During the installation, the system ensures that package management tools are not busy by stopping unattended upgrades temporarily, waiting for locks to clear, and then re-enabling them upon completion.
File and Directory Structure¶
The application and its installation components are organized in specific locations on the server:
| Component | Path | Description |
|---|---|---|
| Installation Directory | /opt/openclaw-ansible | Contains the cloned repository and installation scripts |
| Run Script | /opt/openclaw-ansible/run-playbook.sh | The executable script to deploy the application |
| User Home Directory | /home/openclaw | The home directory for the openclaw system user |
Starting, Stopping, and Updating¶
The deployment relies on the run-playbook.sh script within the /opt/openclaw-ansible directory to manage the application lifecycle.
-
To run the installation or re-deploy the application, execute the script with elevated privileges:
-
The script handles the installation of dependencies and configuration of the OpenClaw environment.
-
Updates to the application can be performed by pulling the latest changes from the
mainbranch within the/opt/openclaw-ansibledirectory and re-executing the run script, as the script includes logic to update the repository and collections.