Skip to content

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 sudo access is required to install system packages and manage user accounts.
  • Software Dependencies: The system must have ansible and git installed.
  • 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_url and checked out to the branch defined in openclaw_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/openclaw for the application user.

Application Installation Process

The installation process involves cloning the repository, installing dependencies, and executing the installer script.

  1. Repository Cloning: The system clones or updates the OpenClaw repository to the specified installation directory.
  2. Dependency Installation: Ansible collections are installed using the requirements.yml file located in the installation directory.
  3. Permission Adjustment: Execute permissions are applied to the run script to ensure it can be executed.
  4. Installer Execution: The OpenClaw installer is run with specific environment variables to optimize memory usage and logging:
  5. NODE_OPTIONS: Set to --max-old-space-size=768
  6. npm_config_jobs: Set to 2
  7. npm_config_loglevel: Set to warn
  8. CI: Set to true

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 openclaw is created with the following attributes:
  • Shell: /bin/bash
  • Groups: Added to the sudo group.
  • Password: Set to a hashed value (default password is openclaw).
  • Directory Ownership: The home directory /home/openclaw is owned by the openclaw user 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_script from within the openclaw_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.

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×