Skip to content

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 ansible and git packages must be installed or available for installation via apt.

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:

  1. Install system packages including ansible and git.

  2. Remove any existing OpenClaw repository at /opt/openclaw-ansible to ensure a clean state.

  3. Clone the OpenClaw repository from https://github.com/openclaw/openclaw-ansible.git into /opt/openclaw-ansible using the main branch.

  4. Install required Ansible collections using ansible-galaxy.

  5. Execute the installation script ./run-playbook.sh located in the installation directory.

  6. The installation script runs with specific environment variables to manage memory and logging:

  7. NODE_OPTIONS: --max-old-space-size=768

  8. npm_config_jobs: 2

  9. npm_config_loglevel: warn

  10. 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 openclaw is 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/openclaw directory and all its contents is recursively assigned to the openclaw user and group.

  • The installation script ./run-playbook.sh is 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:

    cd /opt/openclaw-ansible
    sudo ./run-playbook.sh
    

  • 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 main branch within the /opt/openclaw-ansible directory and re-executing the run script, as the script includes logic to update the repository and collections.

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