Deployment Overview of OpenClaw on Server¶
Prerequisites and Basic Requirements¶
The OpenClaw application requires a Linux environment based on Ubuntu. The following conditions must be met before initiating the deployment:
- Operating System: Ubuntu
- Privileges: Root or
sudoaccess is required to install system packages and manage user accounts. - Software Dependencies: The system must have
ansibleandgitinstalled. - Network Access: The server must be able to reach the OpenClaw repository URL to clone the source code.
File and Directory Structure¶
The application is deployed to a specific directory defined by the openclaw_install_dir variable. The structure includes:
- Installation Directory: The root location where the OpenClaw repository is cloned.
- Source Code: The repository is cloned from the URL specified in
openclaw_repo_urland checked out to the branch defined inopenclaw_branch. - Run Script: The primary execution script is located at
{{ openclaw_install_dir }}/{{ openclaw_run_script }}. - User Home Directory: A dedicated home directory is created at
/home/openclawfor the application user.
Application Installation Process¶
The installation process involves cloning the repository, installing dependencies, and executing the installer script.
- Repository Cloning: The system clones or updates the OpenClaw repository to the specified installation directory.
- Dependency Installation: Ansible collections are installed using the
requirements.ymlfile located in the installation directory. - Permission Adjustment: Execute permissions are applied to the run script to ensure it can be executed.
- Installer Execution: The OpenClaw installer is run with specific environment variables to optimize memory usage and logging:
NODE_OPTIONS: Set to--max-old-space-size=768npm_config_jobs: Set to2npm_config_loglevel: Set towarnCI: Set totrue
The installer is configured to retry up to 3 times with a 30-second delay if it fails.
Access Rights and Security¶
A dedicated system user is created to manage the application, ensuring separation of duties and security.
- User Account: A user named
openclawis created with the following attributes: - Shell:
/bin/bash - Groups: Added to the
sudogroup. - Password: Set to a hashed value (default password is
openclaw). - Directory Ownership: The home directory
/home/openclawis owned by theopenclawuser and group, with recursive ownership applied to all contents.
Starting, Stopping, and Updating¶
The application is managed via the run script located in the installation directory.
- Execution Command: The application is started by executing the script defined in
openclaw_run_scriptfrom within theopenclaw_install_dir. - Update Mechanism: To update the application, the repository is updated to the latest commit on the specified branch, and the installer script is re-executed.
Note: The provided configuration does not include specific service management commands (e.g., systemctl) for starting or stopping the application as a background service; it relies on the direct execution of the installer/run script.