# 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.

**Published:** Mar 19, 2026 | **Author:** Michael Park | **Read time:** 10 min read

Learn how to install and set up OpenClaw on Ubuntu. Simple steps to install Node.js, connect an AI provider, and get your AI agent running instantly.

---

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](https://www.ampere.sh/) runs OpenClaw for you in the cloud.

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](https://www.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:

**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:

**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.


### 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:


### 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:

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


### Step 4: Run the Onboarding Wizard

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

The wizard will ask you to:

- Read and accept the security advisory — select **"Yes, I understand"**
- Choose a setup mode — select **QuickStart** for safe defaults
- Select your AI provider (OpenAI, Claude, Gemini, or others)
- Enter your AI provider API key
- Choose whether to install skills — select **No** for now (you can [add skills later](/blog/best-openclaw-skills/))
- Enable bash shell completion when prompted


### 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

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


### Option B: WhatsApp

- Run: `openclaw connect whatsapp`
- A QR code will appear in your terminal
- Open WhatsApp on your phone → **Settings → Linked Devices → Link a Device**
- 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:

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:

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.


## 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](https://www.ampere.sh/setup)


## 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.
