Back to Article List

Installing OpenClaw on Ubuntu 25.04 and connecting it to Discord

Installing OpenClaw on Ubuntu 25.04 and connecting it to Discord

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 doctor again

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.

Your idea deserves better hosting

24/7 support 30-day money-back guarantee Cancel anytime
Faktureras

1 GB RAM VPS

$3.99 Save  50 %
$1.99 Månadsvis
  • 1 vCPU AMD EPYC
  • 30 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning

2 GB RAM VPS

$4.99 Save  20 %
$3.99 Månadsvis
  • 2 vCPU AMD EPYC
  • 30 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning

6 GB RAM VPS

$13.99 Save  29 %
$9.99 Månadsvis
  • 6 vCPU AMD EPYC
  • 70 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning

AMD EPYC VPS.P1

$6.99 Save  29 %
$4.99 Månadsvis
  • 2 vCPU AMD EPYC
  • 4 GB RAM-minne
  • 40 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Automatisk backup ingår
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning

AMD EPYC VPS.P2

$12.99 Save  31 %
$8.99 Månadsvis
  • 2 vCPU AMD EPYC
  • 8 GB RAM-minne
  • 80 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Automatisk backup ingår
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning

AMD EPYC VPS.P4

$25.99 Save  31 %
$17.99 Månadsvis
  • 4 vCPU AMD EPYC
  • 16 GB RAM-minne
  • 160 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Automatisk backup ingår
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning
Beställ nu Upptagen - Tillgänglig

AMD EPYC VPS.P5

$32.49 Save  29 %
$22.99 Månadsvis
  • 8 vCPU AMD EPYC
  • 16 GB RAM-minne
  • 180 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Automatisk backup ingår
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning

AMD EPYC VPS.P6

$48.99 Save  31 %
$33.99 Månadsvis
  • 8 vCPU AMD EPYC
  • 32 GB RAM-minne
  • 200 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Automatisk backup ingår
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning
Beställ nu Upptagen - Tillgänglig

AMD EPYC VPS.P7

$61.99 Save  35 %
$39.99 Månadsvis
  • 16 vCPU AMD EPYC
  • 32 GB RAM-minne
  • 240 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Automatisk backup ingår
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning
Beställ nu Upptagen - Tillgänglig

EPYC Genoa VPS.G1

$4.99 Save  20 %
$3.99 Månadsvis
  • 1 vCPU AMD EPYC Gen4 AMD EPYC Genoa 4:e generation 9xx4 med 3,25 GHz eller liknande, baserad på Zen 4-arkitekturen.
  • 1 GB DDR5 RAM-minne
  • 25 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Automatisk backup ingår
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning

EPYC Genoa VPS.G2

$9.99 Save  20 %
$7.99 Månadsvis
  • 2 vCPU AMD EPYC Gen4 AMD EPYC Genoa 4:e generation 9xx4 med 3,25 GHz eller liknande, baserad på Zen 4-arkitekturen.
  • 4 GB DDR5 RAM-minne
  • 50 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Automatisk backup ingår
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning

EPYC Genoa VPS.G4

$18.99 Save  32 %
$12.99 Månadsvis
  • 4 vCPU AMD EPYC Gen4 AMD EPYC Genoa 4:e generation 9xx4 med 3,25 GHz eller liknande, baserad på Zen 4-arkitekturen.
  • 8 GB DDR5 RAM-minne
  • 100 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Automatisk backup ingår
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning

EPYC Genoa VPS.G5

$29.99 Save  27 %
$21.99 Månadsvis
  • 4 vCPU AMD EPYC Gen4 AMD EPYC Genoa 4:e generation 9xx4 med 3,25 GHz eller liknande, baserad på Zen 4-arkitekturen.
  • 16 GB DDR5 RAM-minne
  • 150 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Automatisk backup ingår
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning

EPYC Genoa VPS.G6

$34.99 Save  23 %
$26.99 Månadsvis
  • 8 vCPU AMD EPYC Gen4 AMD EPYC Genoa 4:e generation 9xx4 med 3,25 GHz eller liknande, baserad på Zen 4-arkitekturen.
  • 16 GB DDR5 RAM-minne
  • 200 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Automatisk backup ingår
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning

EPYC Genoa VPS.G7

$57.99 Save  26 %
$42.99 Månadsvis
  • 8 vCPU AMD EPYC Gen4 AMD EPYC Genoa 4:e generation 9xx4 med 3,25 GHz eller liknande, baserad på Zen 4-arkitekturen.
  • 32 GB DDR5 RAM-minne
  • 250 GB NVMe lagring
  • Obegränsad bandbredd
  • IPv4 och IPv6 ingår IPv6-stöd är för närvarande inte tillgängligt i Frankrike, Finland eller Nederländerna.
  • 1 Gbps nätverk
  • Automatisk backup ingår
  • Hantering av brandvägg
  • Kostnadsfri serverövervakning

Automate faster, for less

Bring your winning ideas to life with AMD power, NVMe speed and unmetered bandwidth. Everything backed by 24/7 support, plus a 30-day refund period.