This guide walks through installing OpenClaw on Ubuntu 25.04 and connecting it to a Discord bot. The steps work the same way on a local machine or a VPS. In this walkthrough, the setup is done on a VPS because it is easier to manage, stays online, and keeps OpenClaw separate from your daily workstation.
OpenClaw is a self-hosted AI agent that can run models locally or connect to cloud providers, and expose that agent through channels like Discord, Telegram, or a web interface. Once installed, it behaves like a long-running gateway process that receives messages, routes them to a model, and replies back through the chosen channel.
While OpenClaw can be installed on a desktop or laptop, it is generally better to run it on a dedicated system. This avoids unexpected CPU or RAM spikes on your main machine and makes it easier to control uptime, security, and updates.
System requirements and environment
The system used in this guide is a clean Ubuntu 25.04 installation. This can be a VPS or a local server.
Minimum practical requirements:
- 2 vCPU
- 2 GB RAM (4 GB recommended)
- 20 GB SSD (30–50 GB recommended)
- Ubuntu 22.04 or newer (25.04 works fine)
If you plan to run local models later (for example via Ollama), you will need more CPU or GPU resources. For a Discord bot using cloud models, the requirements above are enough.
Preparing Ubuntu 25.04
After logging in via SSH or opening a terminal locally, the first step is updating the system packages.
sudo apt-get update
sudo apt-get upgrade -y
This ensures you are running the latest security patches and libraries. If the upgrade pulls in a new kernel, a reboot is recommended before continuing.
It is also useful to have a few basic tools installed:
sudo apt-get install -y curl git build-essential
curl is required for the OpenClaw installer, git is useful for skills and debugging, and build-essential helps avoid issues with native dependencies.
Installing OpenClaw on Ubuntu 25.04
If you are using a VPS template that already has OpenClaw installed, you can skip this section and continue with onboarding and Discord integration.
For a fresh system, OpenClaw provides an official installation script that handles dependencies automatically.
curl -fsSL https://openclaw.ai/install.sh | bash
The script detects the operating system, installs a supported Node.js version if needed, and installs the OpenClaw CLI and runtime.
After installation finishes, OpenClaw prints a message indicating it is ready to use. You can verify the installation with:
openclaw --version
node -v
If Node.js is missing or broken for any reason, you can install it manually, but in most cases the installer script handles this correctly.
Onboarding OpenClaw using the TUI
Once OpenClaw is installed, the next step is onboarding. This initializes the workspace, configuration files, and gateway environment.
The onboarding process usually starts automatically. If not, you can run:
openclaw onboard

Security notice
The first screen is a security message explaining that OpenClaw can run commands and access files on the system. This is an important reminder that OpenClaw should only be run on systems you trust.
Read the message carefully. If you understand and agree, select Yes to continue.
Select onboarding mode
When prompted for the onboarding mode, select QuickStart. This uses sensible defaults and is ideal for SSH or terminal-based setups.

Model and authentication provider
When asked to select a model or authentication provider, choose Skip for now.

This allows you to complete the setup without committing to OpenAI, Anthropic, or any other provider yet. You can configure models later once the bot is running.
Select providers
At the provider selection step, choose All providers.

This does not enable them automatically; it simply prepares the configuration so you can add API keys later without rerunning onboarding.
Default model
For the default model prompt, leave Keep current selected, even if it shows something like claude-opus.

This value acts as a placeholder until real credentials are added.
Channel selection
When asked to select a channel, choose Skip for now. Discord will be configured manually in the next phase.

Skills configuration
When prompted to configure skills, select No.

This keeps the initial setup simple. Skills can be installed later once the bot is confirmed working.
Hatching
For the hatching step, choose Hatch in TUI.

This finalizes the workspace and completes the onboarding process.

Creating and inviting the Discord bot
The next phase connects OpenClaw to Discord. You will need a Discord account and access to the Discord Developer Portal.
Go to https://discord.com/developers/applications and open the Applications section.

Create a new application.

Give the application a name for your bot.

Save the changes.

Creating the bot and token
Navigate to the Bot section and generate a new bot token.

The token will look similar to this:

Important: Treat this token as a secret. If it leaks, regenerate it immediately.
OAuth permissions
Go to the OAuth2 section and configure scopes and permissions.

Select the required permissions for your bot.

Copy the generated invite URL.

Open the URL in a browser, click Continue, then Authorize.


Once authorized, the bot will appear in your Discord server.


Connecting the Discord bot to OpenClaw
Store the Discord bot token in an environment file used by OpenClaw.
sudo install -d /opt/openclaw
sudo tee /opt/openclaw/.env > /dev/null <<'EOF'
DISCORD_BOT_TOKEN=YOUR_DISCORD_BOT_TOKEN_HERE
EOF

For security, restrict file permissions:
sudo chmod 600 /opt/openclaw/.env
Enable Discord intents
In the Discord Developer Portal, enable the following intents:
- Presence Intent
- Server Members Intent
- Message Content Intent

Adding the Discord channel and starting the gateway
Load the environment variables and add the Discord channel:
set -a && . /opt/openclaw/.env && set +a && openclaw channels add --channel discord --use-env

If errors occur, run diagnostics:
openclaw doctor --fix
Start the gateway:
openclaw gateway --force

Once the gateway is running, the bot becomes active on Discord.

Verifying the setup
Check that the bot appears online in Discord and responds to messages in allowed channels. If it does not respond:
- Verify the bot token and intents
- Check gateway logs
- Run
openclaw doctoragain
At this point, OpenClaw is successfully installed on Ubuntu 25.04 and connected to Discord. You can now configure models, install skills, and harden security based on your use case.
