How to Deploy Openclaw on Linux - Complete Guide

Image
Table of contents: [Show]

Quick Start

Deploy Openclaw on any Linux distribution in minutes. This guide covers the standard installation method using the official installer script, which works on Ubuntu, Debian, Fedora, Arch, and most other distros.

Openclaw on Linux

Prerequisites

  • A Linux system with internet access
  • curl installed
  • sudo privileges (for systemd service setup)

Step 1: Run the Installer

The official installer automatically detects your OS, installs Node.js 22+ if missing, and sets up the Openclaw CLI globally.

curl -fsSL https://Openclaw.ai/install.sh | bash

After installation completes, reload your shell or run source ~/.bashrc to access the openclaw command.

Step 2: Configure with Onboarding

Run the onboarding wizard to set up your model provider and install the Gateway as a background service:

openclaw onboard --install-daemon

The wizard will guide you through:

  1. Selecting your AI model provider (Anthropic, OpenAI, etc.)
  2. Entering your API key
  3. Configuring your workspace directory
  4. Setting up chat channels (Discord, Telegram, etc.)

Step 3: Enable Service Lingering

By default, Linux systemd user services stop when you log out. To keep Openclaw running 24/7, enable lingering for your user:

sudo loginctl enable-linger $USER

This ensures the Gateway stays active even after you disconnect SSH.

Step 4: Launch the Dashboard

Open the WebChat interface to start interacting with your agent:

openclaw dashboard

This opens your default browser to the local dashboard where you can chat with your agent and manage settings.

Related Guides

For more deployment options, check out our guides on VPS Deployment for production setups, or macOS Installation if you also use Apple devices.

Openclaw Web Tools

Troubleshooting

Node.js Version Issues

If you see errors about Node.js version, the installer should handle this automatically. If not, install Node.js 22+ manually using your package manager or nodejs.org.

Permission Denied Errors

Ensure your user has proper permissions for the installation directory:

sudo chown -R $USER:$USER ~/.openclaw

Service Not Starting

Check the service status and logs:

systemctl --user status openclaw-gateway
journalctl --user -u openclaw-gateway -f

Port Already in Use

If port 18789 is occupied, specify an alternative during onboarding or edit ~/.openclaw/openclaw.json to change the gateway port.

Best Practices

  • Use a dedicated user: For production deployments, create a separate Linux user for Openclaw
  • Enable firewall: Configure UFW or iptables to restrict access to the Gateway port
  • Back up your config: Regularly backup ~/.openclaw/openclaw.json and your workspace
  • Monitor logs: Set up log rotation for long-running instances