OpenClaw Server Deployment Overview¶
Prerequisites¶
To ensure a successful application deployment, the following requirements must be met:
-
Operating System: Debian 11+ or Ubuntu 20.04+.
-
Access Rights: Superuser (root) privileges or
sudoaccess are required. -
Ports:
-
22/tcp— SSH (default access). -
80/tcpand443/tcp— HTTP and HTTPS for the web interface. -
18789/tcp— OpenClaw gateway port (default). -
41641/udp— If Tailscale is used.
FQDN of the final panel on hostkey.in domain¶
| Parameter | Value |
|---|---|
| Prefix | openclaw |
| Domain | hostkey.in |
| Full Template | openclaw{Server_ID_from_Invapi}.hostkey.in |
File and Directory Structure¶
After installation, the data and configuration structure will be as follows:
-
/home/openclaw/.openclaw/— Main application directory (configurations, logs, sessions). -
/data/nginx/— Custom Nginx configurations. -
/root/nginx/— Docker Compose files for the reverse proxy. -
/etc/docker/daemon.json— Docker daemon settings.
Application Installation Process¶
Deployment is performed using the install.sh installation script, which prepares the environment and initiates the automatic configuration process.
Main Installation Stages:¶
-
System Preparation: Installation of necessary system utilities (
curl,git,sudo,vim,jq, etc.) and updating the package cache. -
Node.js Environment Setup: Installation of Node.js (version 22.x) and the
pnpmpackage manager. -
User Creation: Creation of the
openclawsystem user with restricted access rights viasudoers. -
Application Installation:
-
In release mode (default): Global installation via
pnpm install -g openclaw@latest. -
In development mode: Cloning the repository from GitHub, building from source (
pnpm build), and creating symbolic links in system paths. -
Security Configuration: Configuring the
UFWfirewall (allowing SSH and HTTP/HTTPS) and installingfail2banto protect against SSH brute-force attacks.
Access Rights and Security¶
System security is ensured by the following mechanisms:
-
User: All application processes run under the
openclawuser. -
Firewall (UFW):
-
A default deny policy for incoming connections is implemented.
-
Docker isolation is configured via rules in
/etc/ufw/after.rulesto prevent unauthorized external access to containers. -
SSH Protection:
fail2banis configured to block IP addresses after several failed login attempts. -
Automatic Updates: The
unattended-upgradesservice is enabled for automatic installation of security updates.
Databases¶
The application uses local session and data storage located in the user's home directory: /home/openclaw/.openclaw/. Specific connection settings for external DBs (if required) are configured via the config.yml configuration file.
Docker Containers and Execution¶
A containerized reverse proxy is used to ensure web interface operation over the secure HTTPS protocol.
| Image Name | Ports | Volumes | Environment Variables | Restart Policy |
|---|---|---|---|---|
jonasal/nginx-certbot:6.2.0-nginx1.31.0 | 80, 443 (host mode) | - nginx_secrets:/etc/letsencrypt- /data/nginx/user_conf.d:/etc/nginx/user_conf.d- /data/nginx/letsencrypt:/var/www/letsencrypt | [email protected] | unless-stopped |
Custom Scripts and Additional Settings¶
The following actions are performed during the deployment process:
-
User Environment Setup: Paths to
pnpmbinaries are added to theopenclawuser's.bashrc. -
OpenClaw Initialization: After installation, it is necessary to run the command
openclaw onboard --install-daemon, which creates the main configuration file~/.openclaw/config.json. -
System Service Setup: A
systemdservice namedopenclaw-gateway.serviceis created and enabled to ensure the application starts automatically upon system boot.
Application Update Instructions¶
To update the core application, use the following commands depending on the installation mode:
-
If the npm version (release) is installed:
-
If using development mode:
Configuration Files and Data Locations¶
| File Type | Path |
|---|---|
| Main application config | /home/openclaw/.openclaw/config.yml |
| Nginx configuration (proxy) | /data/nginx/user_conf.d/{domain}.conf |
| Application logs | /home/openclaw/.openclaw/logs/openclaw.log |
Available Connection Ports¶
-
80(HTTP) — Redirects to HTTPS. -
443(HTTPS) — Main port for the management web interface. -
18789(TCP) — OpenClaw gateway port.
Starting and Stopping the Application¶
Application management is performed via the system service manager:
-
Start:
sudo systemctl start openclaw -
Stop:
sudo systemctl stop openclaw -
Restart:
sudo systemctl restart openclaw -
View Status:
openclaw statusorsudo systemctl status openclaw -
View Logs:
openclaw logsorsudo journalctl -u openclaw -f