How to Install OpenClaw on Ubuntu
.jpg)
OpenClaw is a free, open-source AI agent that runs locally on your machine and connects to messaging platforms like WhatsApp, Telegram, Slack, and Discord. It can execute shell commands, manage files, automate workflows, and act as a 24/7 personal assistant you message from anywhere.
Ubuntu is one of the best platforms for running OpenClaw. Linux gives you headless operation with no GUI overhead, systemd for automatic restarts, and rock-solid uptime. Whether you are setting up on a local Ubuntu desktop, a VPS, or a Raspberry Pi, this guide walks you through every step.
How to Install OpenClaw on Ubuntu
The installation process works on Ubuntu 22.04 LTS, Ubuntu 24.04 LTS, and other Debian-based distributions like Linux Mint and Pop!_OS. The entire setup takes around 10 minutes from a fresh terminal to a running AI agent.
What You Need Before Starting
Before you begin, make sure you have the following ready: a machine running Ubuntu 22.04 or newer with at least 4GB of RAM (8GB recommended), sudo or root access, an API key from your preferred LLM provider (Anthropic, OpenAI, or a local model through Ollama), and optionally, a messaging app account like Telegram or Discord for connecting a channel.
Step 1: Update Your System
Start with a clean, updated environment. Open your terminal and run:
sudo apt update && sudo apt upgrade -y
Then install essential dependencies:
sudo apt install -y curl git wget build-essential
These packages ensure that Node.js and OpenClaw's native modules compile without issues.
Step 2: Install Node.js 22 Using NVM
OpenClaw requires Node.js version 22 or higher. The recommended way to install it on Ubuntu is through NVM (Node Version Manager), which lets you manage Node.js versions cleanly without conflicting with system packages.
Install NVM:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
Reload your shell:
source ~/.bashrc
Install Node.js 22 LTS:
nvm install 22
nvm use 22
Verify the installation:
node --version
npm --version
You should see Node.js 22.x.x or newer. Using NVM instead of the default Ubuntu repository version is important because Ubuntu's built-in Node.js packages are often outdated and may not meet OpenClaw's minimum requirements.
Step 3: Install OpenClaw
With Node.js ready, install OpenClaw globally using npm:
npm install -g openclaw@latest
Once the installation finishes, launch the onboarding wizard:
openclaw onboard --install-daemon
The --install-daemon flag is key on Linux. It creates a systemd user service so OpenClaw starts automatically on boot and restarts after crashes. This is what makes your Ubuntu machine a true always-on AI server.
The onboarding wizard walks you through the following:
- A security acknowledgment. OpenClaw can run commands and access files on your system, so you need to confirm you understand the risks.
- Selecting your LLM provider. Choose from Anthropic (Claude), OpenAI (GPT), Google Gemini, or local models via Ollama.
- Entering your API key.
- Setting the Gateway bind address. Select 127.0.0.1 (loopback/localhost) for security. This ensures the gateway is only accessible from the machine itself.
- Choosing a messaging channel. Telegram is the easiest to start with on a headless Linux server. You can add more channels later.
- Configuring optional skills and hooks. You can skip these during initial setup.
Step 4: Verify the Installation
After onboarding completes, run these commands to confirm everything is working:
openclaw --version
openclaw doctor
openclaw gateway status
The openclaw doctor command checks your configuration, gateway connection, and common issues. If the gateway is running, send a test message through your connected messaging channel. Your OpenClaw agent should respond.
Step 5: Set Up the Firewall
If you are running OpenClaw on a VPS or any internet-facing server, configure UFW (Uncomplicated Firewall) to lock things down:
sudo apt install -y ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp
sudo ufw enable
Always allow SSH (port 22) before enabling the firewall, or you will lock yourself out. Do not expose OpenClaw's gateway port (18789) to the internet. Use SSH tunneling or a VPN like Tailscale if you need remote access.
Running Local Models with Ollama on Ubuntu
If you want to avoid cloud API costs entirely, you can run AI models locally using Ollama. This keeps all data on your machine and eliminates subscription fees.
Install Ollama:
curl -fsSL https://ollama.com/install.sh | sh
Pull a model:
ollama pull llama3.1
Configure OpenClaw to use your local model during onboarding or by editing the configuration file at ~/.openclaw/config.yaml. With 16GB of RAM, 7B to 13B parameter models run well. For 70B models, you will need 48GB or more.
Managing OpenClaw with systemd
One of the biggest advantages of running OpenClaw on Ubuntu is native systemd integration. If you used the --install-daemon flag during onboarding, the service is already set up.
Check the service status:
systemctl --user status openclaw
View live logs:
journalctl --user -u openclaw -f
Restart the service after configuration changes:
systemctl --user restart openclaw
The systemd service ensures your AI agent survives reboots, terminal closures, and crashes without any manual intervention.
Connecting OpenClaw to Your Business Workflows
Once your agent is live, the real value comes from connecting it to the tools and platforms your team already uses. OpenClaw supports Telegram, WhatsApp, Slack, Discord, Google Chat, Signal, and many more.
For businesses that want to deploy AI agents without managing servers or writing code, FwdSlash provides a no-code platform to build and launch AI agents for small businesses across websites, customer support, and internal operations. You can also explore how to integrate ChatGPT with Slack or learn the advantages of AI agents for small businesses to see practical applications beyond the technical setup.
Conclusion
Ubuntu is arguably the best platform for running OpenClaw in production. The combination of headless operation, systemd service management, and minimal resource usage makes it ideal for always-on AI agent deployments. Whether you are running it on a local machine, a cheap VPS, or a Raspberry Pi, the steps above will get you from zero to a fully operational agent in about 10 minutes.
Frequently Asked Questions
1) What version of Ubuntu do I need for OpenClaw?
OpenClaw works on Ubuntu 22.04 LTS and newer, including Ubuntu 24.04 LTS. The commands in this guide also work on Debian-based distributions like Linux Mint, Pop!_OS, and Debian 11 or 12.
2) Can I run OpenClaw on a Raspberry Pi?
Yes. OpenClaw is a Node.js application with modest resource requirements. A Raspberry Pi 4 with 8GB of RAM can run OpenClaw with cloud-based LLM providers without issues. Local model inference is limited on Pi hardware due to RAM constraints.
3) How do I keep OpenClaw running after I close the terminal?
Use the --install-daemon flag during onboarding to create a systemd service. This runs OpenClaw in the background and starts it automatically on boot. You can check its status anytime with systemctl --user status openclaw.
4) Is Docker a better option than installing directly on Ubuntu?
Docker provides stronger isolation and is useful if you want to sandbox OpenClaw completely. However, direct installation is simpler, uses fewer resources, and integrates natively with systemd. For most single-user setups, installing directly is the recommended approach.
5) What LLM providers work with OpenClaw on Ubuntu?
OpenClaw supports Anthropic (Claude), OpenAI (GPT), Google Gemini, DeepSeek, and local models through Ollama. The provider choice is the same across all operating systems. For the best quality and security, Anthropic's Claude models are recommended by the project's creator.
Lastest blog posts
Tool and strategies modern teams need to help their companies grow.


