#How to setup the OpenClaw on my Ubuntu VM
18 messages ยท Page 1 of 1 (latest)
Yep, on an Ubuntu VM the cleanest path is:
- Install OpenClaw
curl -fsSL https://openclaw.ai/install.sh | bash
openclaw onboard --install-daemon
- Create a Discord bot in the Discord Developer Portal, then:
- enable Message Content Intent
- recommended: Server Members Intent
- invite it to your own/private server
- copy:
- Bot Token
- Server ID
- your User ID
- On the VM, set the token:
export DISCORD_BOT_TOKEN="YOUR_BOT_TOKEN"
openclaw config set channels.discord.token --ref-provider default --ref-source env --ref-id DISCORD_BOT_TOKEN
openclaw config set channels.discord.enabled true --strict-json
openclaw gateway restart
-
DM your bot in Discord, it should give you a pairing code.
-
Approve the pairing:
openclaw pairing list discord
openclaw pairing approve discord <CODE>
After that, Discord DMs should work.
If you also want it to reply in server channels, do that next with the guild allowlist in the Discord docs.
Docs:
- Install: https://docs.openclaw.ai/install
- FAQ: https://docs.openclaw.ai/help/faq
- Discord setup: https://docs.openclaw.ai/channels/discord
If you want, I can give you the exact next step for either:
- DM-only setup, or
- full Discord server setup
โ Gemini CLI OAuth โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ You are running in a remote/VPS environment. โ
โ A URL will be shown for you to open in your LOCAL browser. โ
โ After signing in, copy the redirect URL and paste it back here. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ Gemini CLI OAuth failed
โ
โ OAuth help โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ Trouble with OAuth? Ensure your Google account has Gemini CLI access. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Error: Gemini CLI not found. Install it first: brew install gemini-cli (or npm install -g @google/gemini-cli), or set GEMINI_CLI_OAUTH_CLIENT_ID.
openclaw: command not found
whitedevil@ubuntu:~$ npm install -g @google/gemini-cli
npm warn deprecated prebuild-install@7.1.3: No longer maintained. Please contact the author of the relevant native addon; alternatives are available.
added 42 packages in 21s
9 packages are looking for funding
run npm fund for details
whitedevil@ubuntu:~$ openclaw onboard --install-daemon
openclaw: command not found
whitedevil@ubuntu:~$ openclaw
openclaw: command not found
How fix this?
The main issue is simpler: you installed Gemini CLI, not OpenClaw.
gemini and openclaw are separate commands.
Try this first:
curl -fsSL https://openclaw.ai/install.sh | bash
Then open a new shell, or run:
hash -r
openclaw --version
openclaw onboard --install-daemon
If openclaw is still โcommand not foundโ, itโs a PATH issue. Run:
npm prefix -g
echo "$PATH"
export PATH="$(npm prefix -g)/bin:$PATH"
echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
hash -r
openclaw --version
If you want the npm route instead of the installer:
npm install -g openclaw@latest
hash -r
openclaw --version
Also, Gemini OAuth is optional. You do not need Gemini CLI just to connect OpenClaw to Discord. Get openclaw working first, then do Discord setup.
Docs:
- Install: https://docs.openclaw.ai/install
- PATH troubleshooting: https://docs.openclaw.ai/install/node#troubleshooting
- Discord setup: https://docs.openclaw.ai/channels/discord
If you want, paste the output of these 3 commands next and Iโll tell you the exact fix:
node -v
npm prefix -g
echo "$PATH"
whitedevil@ubuntu:~$ curl -fsSL https://openclaw.ai/install.sh | bash
๐ฆ OpenClaw Installer
I'm not saying your workflow is chaotic... I'm just bringing a linter and a helmet.
โ Detected: linux
Install plan
OS: linux
Install method: npm
Requested version: latest
[1/3] Preparing environment
โ Node.js v22.22.2 found
ยท Active Node.js: v22.22.2 (/usr/bin/node)
ยท Active npm: 10.9.7 (/usr/bin/npm)
[2/3] Installing OpenClaw
โ Git already installed
ยท Installing OpenClaw (latest)
! npm install failed for openclaw@latest
Command: env SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm --loglevel error --silent --no-fund --no-audit install -g openclaw@latest
Installer log: /tmp/tmp.uSZSuHQAjB
! npm install failed; showing last log lines
! npm install failed; retrying
Nice, thatโs progress, the installer is running now.
The failure is inside the npm install step, and the real reason is in that temp log.
Please run these and paste the output:
tail -80 /tmp/tmp.uSZSuHQAjB
npm config get prefix
npm prefix -g
Also, if you want the installer to show more detail on the next run:
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --verbose
Two common Ubuntu causes:
- npm permissions / EACCES
mkdir -p "$HOME/.npm-global"
npm config set prefix "$HOME/.npm-global"
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
hash -r
- sharp / libvips issue
SHARP_IGNORE_GLOBAL_LIBVIPS=0 curl -fsSL https://openclaw.ai/install.sh | bash
So, first paste the tail -80 /tmp/tmp.uSZSuHQAjB output, that should tell us which one it is.
Docs:
- Install: https://docs.openclaw.ai/install
- Installer troubleshooting: https://docs.openclaw.ai/install/installer
whitedevil@ubuntu:~$ mkdir -p "$HOME/.npm-global"
npm config set prefix "$HOME/.npm-global"
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
hash -r
npm error code ENOSPC
npm error syscall write
npm error errno -28
npm error nospc ENOSPC: no space left on device, write
npm error nospc There appears to be insufficient space on your system to finish.
npm error nospc Clear up some disk space and try again.
npm error A complete log of this run can be found in: /home/whitedevil/.npm/_logs/2026-04-15T14_40_33_291Z-debug-0.log
Yep, we found it, your VM is just out of disk space.
This is not an OpenClaw bug now, npm canโt even write its own config/log files.
Please check both disk space and inodes:
df -h
df -i
du -sh ~ /tmp ~/.npm 2>/dev/null
What to do next:
- free up at least 2 to 4 GB
- if
df -hlooks fine but installs still fail, checkdf -ibecause you may be out of inodes - after freeing space, rerun:
curl -fsSL https://openclaw.ai/install.sh | bash
If you want, paste the output of:
df -h
df -i
and Iโll tell you the quickest thing to clean up.
Ok. Which Model/auth provider i should use? for free.
Short version: for free, your main option is Gemini CLI OAuth.
A few important caveats though:
- Gemini CLI OAuth is the closest thing to a free hosted setup
- but in OpenClaw itโs an unofficial integration
- docs explicitly warn that some users reported Google account restrictions
- if you try it, use a non-critical Google account
If you want the least headache, a paid API key provider is usually smoother.
If you want zero cost, Gemini CLI OAuth is the one Iโd look at first.
A couple blunt notes:
- Discord integration and model provider are separate things
- I would not start with local models for a first Discord setup unless you already have strong hardware
- model recommendations change fast, so for โwhat actually works best todayโ, ask in #models