How to Setup OpenClaw in Ubuntu
Step-by-step guide to install and configure OpenClaw AI assistant on Ubuntu Published at 2026-02-05

Note: This article was generated by AI in OpenClaw. Nusendra only asked the AI to create a new article in WhatsApp, then AI in his Raspberry Pi home server will do the rest.

OpenClaw is an AI assistant that handles messaging, file operations and web browsing locally on your machine. Here’s how to install and configure it on Ubuntu.

Prerequisites

  • Ubuntu 20.04 LTS or later
  • Node.js 18+ installed
  • npm or yarn package manager
  • Git installed
  • At least 2GB RAM (4GB recommended)

Step 1: install Node.js and npm

If Node.js isn’t installed yet, use the NodeSource repository:

# Update package list
sudo apt update

# Install curl if not present
sudo apt install -y curl

# Install Node.js 18
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs

# Verify installation
node --version
npm --version

Step 2: install OpenClaw

OpenClaw ships on npm. Install it globally:

# Install OpenClaw globally
sudo npm install -g openclaw

# Verify installation
openclaw --version

Step 3: initialize OpenClaw

Create a workspace for your instance:

# Create workspace directory
mkdir -p ~/openclaw-workspace
cd ~/openclaw-workspace

# Initialize OpenClaw
openclaw init

init creates the basic structure, including SOUL.md, USER.md and AGENTS.md.

Step 4: configure it

Set up your identity

Edit IDENTITY.md to define who your assistant is:

# IDENTITY.md - Who Am I?

- **Name:** OpenClaw
- **Creature:** AI Assistant
- **Vibe:** Helpful and efficient
- **Emoji:** 🐺
- **Avatar:** /path/to/avatar.png

Configure user details

Edit USER.md with your own information:

# USER.md - About Your Human

- **Name:** Your Name
- **Timezone:** Asia/Jakarta
- **Notes:** Any preferences or special instructions

Step 5: set up a messaging channel

OpenClaw supports several messaging platforms. For WhatsApp:

# Start WhatsApp configuration
openclaw whatsapp setup

That generates a QR code. Scan it with WhatsApp to link your account.

Step 6: start OpenClaw

# Start OpenClaw
openclaw start

The output should show OpenClaw running and ready to receive messages.

Step 7: test it

Send a message to the WhatsApp number linked to OpenClaw and you should get a reply. Something like “Who are you?”, “What can you do?” or “Tell me a joke” is enough to confirm it’s working.

Optional: advanced configuration

Run it as a background service

For persistent operation, set OpenClaw up as a systemd service:

# Create systemd service file
sudo nano /etc/systemd/system/openclaw.service

Add the following:

[Unit]
Description=OpenClaw AI Assistant
After=network.target

[Service]
Type=simple
User=nusendra
WorkingDirectory=/home/nusendra/openclaw-workspace
ExecStart=/usr/bin/openclaw start
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

Enable and start it:

sudo systemctl enable openclaw
sudo systemctl start openclaw

# Check status
sudo systemctl status openclaw

Environment variables

Create a .env file in your workspace for custom configuration:

# OpenClaw environment variables
OPENCLAW_MODEL=openrouter/arcee-ai/trinity-large-preview:free
OPENCLAW_THINKING=off
OPENCLAW_DEFAULT_CHANNEL=whatsapp

Common issues

Port conflicts

Change the default port:

# Set custom port
export OPENCLAW_PORT=3001
openclaw start

Memory

If OpenClaw crashes under memory pressure, cap its usage:

# Reduce memory usage
export OPENCLAW_MEMORY_LIMIT=2048
openclaw start

Check what the machine actually has free with free -h.

Updating

sudo npm update -g openclaw

OpenClaw won’t start

Check the logs:

openclaw logs

WhatsApp not responding

Verify the gateway:

openclaw whatsapp status

Security

Keep the workspace file permissions tight:

# Set secure permissions
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pub

And if you’re exposing OpenClaw to the internet, open only the port it needs:

# Allow OpenClaw port
sudo ufw allow 3000/tcp

Next steps

From here you can customise the assistant by editing the .md files in your workspace, install additional OpenClaw skills, integrate services like calendars and email, and build automation workflows with the built-in tools.