Blog

How to Set Up OpenClaw on Ubuntu and Connect Your AI Agent

Install OpenClaw on Ubuntu instantly. This guide walks you through every step — from Node.js setup to connecting your AI agent on Telegram or WhatsApp.

10 min read
Mar 19, 2026
Ampere Team

Ubuntu is one of the most popular environments for running OpenClaw — whether on a local machine, a home server, or a VPS. The OpenClaw Linux installer works natively on Ubuntu 22.04 and 24.04 with no workarounds required. Install Node.js, run one curl command, and your AI agent is live.

This guide covers every step — from system setup to connecting your agent on Telegram or WhatsApp. Want to skip the setup? Ampere.sh runs OpenClaw for you in the cloud.

Ubuntu 22.04 vs 24.04 — Which Version to Use?

Both Ubuntu 22.04 LTS and 24.04 LTS work well with OpenClaw. Here's a quick comparison to help you decide:

Feature
Ubuntu 22.04 LTS
Ubuntu 24.04 LTS
Support Until
April 2027
April 2029
Node.js 22 via NodeSource
✅ Supported
✅ Supported
systemd Version
249
255
OpenClaw Compatibility
✅ Fully compatible
✅ Fully compatible
Recommended For
Existing servers / VPS
New installs (best choice)

TL;DR: If you're setting up a new machine or VPS, go with Ubuntu 24.04 LTS — it has longer support and the latest tooling. If you're already on 22.04, stay on it — everything works perfectly.

Ubuntu Requirements for OpenClaw

Before you start, make sure your Ubuntu machine meets these requirements:

Requirement
Minimum
Recommended
Ubuntu Version
22.04 LTS
24.04 LTS
Node.js
22.16+ (LTS)
Node 24
RAM
512 MB
1 GB+
Disk Space
500 MB free
1 GB+ free
Internet
Required
Stable connection
User Access
sudo privileges
Non-root user with sudo

Important: Do not run OpenClaw as root. Use a regular user account with sudo access — this avoids file permission issues and keeps your system more secure.

How to Install OpenClaw on Ubuntu (Step by Step)

Follow these steps in order. The entire process takes about 10 minutes on a fresh Ubuntu install.

Step 1: Update Your System

Start with a clean, fully updated system. This prevents dependency conflicts during the Node.js and OpenClaw installs.

sudo apt update && sudo apt upgrade -y sudo apt install -y curl wget git
Ubuntu terminal showing apt update and upgrade running on Ubuntu 22.04

Step 2: Install Node.js 22+ via NodeSource

OpenClaw requires Node.js 22 or higher. The version in Ubuntu's default apt repositories is outdated — use NodeSource to install the correct version:

# Add NodeSource repository for Node.js 22 curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - # Install Node.js sudo apt install -y nodejs # Verify the version node --version # Should show v22.x.x or higher npm --version
Ubuntu terminal showing NodeSource Node.js 22 installation and version verification

Step 3: Run the OpenClaw Linux Installer

This single command downloads and runs the official OpenClaw installer. It detects Ubuntu automatically, installs all dependencies, and adds OpenClaw to your PATH:

curl -fsSL https://install.openclaw.ai | bash

After the installer finishes, reload your shell so the openclaw command is available:

source ~/.bashrc # Verify installation openclaw --version
OpenClaw curl installer running in Ubuntu terminal with successful version verification

Step 4: Run the Onboarding Wizard

Start the interactive setup. This configures your AI provider, API key, and agent preferences:

openclaw onboard

The wizard will ask you to:

  1. Read and accept the security advisory — select "Yes, I understand"
  2. Choose a setup mode — select QuickStart for safe defaults
  3. Select your AI provider (OpenAI, Claude, Gemini, or others)
  4. Enter your AI provider API key
  5. Choose whether to install skills — select No for now (you can add skills later)
  6. Enable bash shell completion when prompted
OpenClaw onboarding wizard in Ubuntu terminal showing AI provider selection screen

Step 5: Connect a Messaging Channel

After onboarding, connect your agent to a messaging app so you can chat with it. The two most common options are:

Option A: Telegram

  1. Open Telegram and search for @BotFather
  2. Send /newbot and follow the prompts to name your bot
  3. Copy the bot token BotFather gives you
  4. In your terminal, run: openclaw connect telegram
  5. Paste the token when prompted — your agent is now live on Telegram

Option B: WhatsApp

  1. Run: openclaw connect whatsapp
  2. A QR code will appear in your terminal
  3. Open WhatsApp on your phone → Settings → Linked Devices → Link a Device
  4. Scan the QR code — your agent is connected

Step 6: Enable Auto-Start with systemd

By default, OpenClaw stops when you close your terminal. Register it as a systemd service so it starts automatically on every reboot:

# Install OpenClaw as a systemd daemon openclaw onboard --install-daemon # Verify the service is running systemctl status openclaw

You should see Active: active (running). Your agent now runs 24/7 in the background — even after reboots.

Step 7: Secure the Port with UFW

OpenClaw runs a local dashboard on port 18789. If your Ubuntu machine is publicly accessible (VPS or home server), block this port from external access:

# Allow SSH access sudo ufw allow ssh # Block OpenClaw dashboard from the internet sudo ufw deny 18789 # Enable firewall sudo ufw enable # Confirm rules sudo ufw status

The dashboard remains accessible from your local machine at http://localhost:18789. For full hardening steps, see the OpenClaw security guide.

Real Use Cases of OpenClaw on Ubuntu

Once your agent is live, here's what people actually use OpenClaw for on Ubuntu:

Server Monitoring via Chat

Message your agent on Telegram to check CPU usage, disk space, memory, or uptime — without opening an SSH terminal.

Scheduled Automations

Run daily backups, cleanup scripts, or report generation automatically using Ubuntu's cron and OpenClaw skills.

Personal Dev Assistant

Ask your agent to review code, explain error logs, write bash scripts, or summarize documentation from any device.

Custom Alerts and Notifications

Set up alerts for website downtime, high server load, or file changes and get instant Telegram or WhatsApp messages.

Research and Summarization

Ask your agent to search the web, summarize articles, or pull content from URLs and get results delivered straight to your chat.

File and Data Management

Organize folders, rename files in bulk, process CSVs, or summarize documents through a simple chat command.

Frequently Asked Questions

Does OpenClaw work on Ubuntu 20.04?
Ubuntu 20.04 is not officially recommended — Node.js 22 (required) is easier to install on 22.04 or 24.04 via NodeSource. If you're still on 20.04, you can still install Node 22 manually via NodeSource, but upgrading to 22.04+ is strongly recommended.
Do I need a desktop or GUI to run OpenClaw on Ubuntu?
No — OpenClaw runs entirely in the background as a daemon. Ubuntu Server (no GUI) works perfectly. Connect your agent to Telegram, WhatsApp, or Discord and interact from your phone.
How much RAM does OpenClaw need on Ubuntu?
Minimum 512MB RAM. For comfortable performance with AI tasks, 1GB or more is recommended. A basic $4–6/month VPS is enough for a personal OpenClaw agent.
How do I check if OpenClaw is running on Ubuntu?
Run 'systemctl status openclaw' if you installed the daemon, or 'openclaw status' from the terminal. You can also check 'ps aux | grep openclaw' to confirm the process is active.
How do I update OpenClaw on Ubuntu?
Run 'openclaw update' from the terminal. Or re-run the original install command: curl -fsSL https://install.openclaw.ai | bash. This will update to the latest version without losing your config.
How do I uninstall OpenClaw from Ubuntu?
Run 'openclaw uninstall' to remove the agent and daemon. Your config at ~/.openclaw/ is kept by default — delete that folder manually if you want a full clean removal.
Can I run OpenClaw on a Ubuntu VPS or cloud server?
Yes — it's one of the most popular setups. Any Ubuntu VPS with 1GB RAM works. For a fully managed option where you skip server setup entirely, Ampere.sh deploys OpenClaw for you.
Can I run multiple OpenClaw agents on one Ubuntu machine?
Yes. Each instance runs on a different port and uses a separate config directory. Advanced users can run multiple agents for different messaging channels or AI providers on the same server.

Skip the Setup — Let Ampere.sh Run OpenClaw for You

Don't want to manage a server? Ampere.sh deploys and maintains your OpenClaw agent in the cloud — no Ubuntu setup, no terminal, no maintenance.

Try Ampere.sh