#Sandbox

1 messages Β· Page 1 of 1 (latest)

brittle hollow
#

why my aganet cant access the vps and make changes?

glacial cargoBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> βœ… Mark Solution

next flareBOT
#

Your agent can’t β€œreach into a random VPS” by itself.

In OpenClaw, the Gateway host is where the agent lives (sessions + tools run there). So what it can change depends on where your Gateway is running:

1) If your Gateway is running on your laptop

Then exec/file changes happen on your laptop, not on the VPS.
To run commands on the VPS, you need to either:

2) If your Gateway is already running on the VPS

Then the agent can change the VPS β€” but only if:

  • the exec tool is allowed for that agent, and
  • exec approvals/allowlist/security aren’t blocking it.

Quick triage (paste output)

#

On the machine where the Gateway runs:

openclaw --version
openclaw status
openclaw nodes status
openclaw devices list

Also tell me: where is your Gateway running (local or VPS)? and what exactly you mean by β€œmake changes” (run shell commands? edit repo files? restart services?).

brittle hollow
#

yes run sell commands

next flareBOT
#

To run shell commands on your VPS, OpenClaw needs an actual execution surface there.

By default, the exec tool runs on the machine where the Gateway is running β€” it does not β€œSSH into your VPS” automatically.

You’ve got 2 sane options:

Option A (simplest): run the Gateway on the VPS

Then the agent is β€œliving on the VPS” and exec runs there.

VPS install guides are here: https://docs.openclaw.ai/help/faq#where-are-the-cloudvps-install-guides

Option B: keep Gateway where it is, add the VPS as a node host

This is the β€œrun commands on another machine” design.

  1. On the VPS, start a node host that connects back to your Gateway:
    Docs + exact flow: https://docs.openclaw.ai/nodes (see Remote node host (system.run))
#
  1. Approve the node pairing on the Gateway host:
openclaw devices list
openclaw devices approve <requestId>
openclaw nodes status
  1. Point exec to that node:
openclaw config set tools.exec.host node
openclaw config set tools.exec.node "<node-id-or-name>"

Then exec calls will run on the VPS node (still subject to approvals/allowlist).


#

Quick questions so I can tell you which path fits:

  1. Where is your Gateway running right now (your laptop/PC or the VPS)?
  2. Are the Gateway + VPS on the same network / Tailscale tailnet, or only reachable via SSH?
  3. What error do you get when you try to run a command? (paste the exact message)
brittle hollow
#

on my pc. But i am using vps.
only reachable via ssh.
Errors: connetion refused, timeout connection to port 22. Permission denied (publickey)

next flareBOT
#

Those SSH errors mean this is not an OpenClaw problem yet β€” your PC can’t reliably SSH to the VPS, so the agent can’t β€œrun shell on the VPS” either.

Also: OpenClaw doesn’t SSH into machines by default. If your Gateway is on your PC, exec runs on your PC unless you either (a) run the Gateway on the VPS, or (b) add the VPS as a node host (which still requires network connectivity).

Step 1: fix SSH from your PC β†’ VPS

These 3 errors are different failure points:

A) timeout connecting to port 22

Your PC can’t reach port 22 at all.

  • wrong IP / wrong port (some VPSes use a non-22 port)
  • VPS is down
  • firewall / security group doesn’t allow inbound 22
  • sshd not running, but usually that’s β€œrefused” not β€œtimeout”

B) connection refused

Host reachable, but nothing is listening on 22.

  • sshd not running
#
  • sshd moved to another port
  • local firewall rejects

C) Permission denied (publickey)

Network is fine, but auth failed.

  • wrong username (common: root vs ubuntu vs debian)
  • wrong private key used
  • public key not in ~/.ssh/authorized_keys on the VPS
  • file permissions wrong on the VPS (~/.ssh and authorized_keys)

Run this locally and paste the relevant lines:

ssh -v user@your-vps-ip

Step 2: choose the OpenClaw setup that matches what you want

#

Option A (recommended if you β€œuse the VPS”): run the Gateway on the VPS

Then the agent lives on the VPS and shell commands run there naturally.
Remote access doc: https://docs.openclaw.ai/gateway/remote

Option B: keep Gateway on PC, run commands on VPS via a node host

This requires the VPS to be able to reach the Gateway WS (or you use a tunnel / Tailscale).
Nodes doc: https://docs.openclaw.ai/nodes (see β€œRemote node host (system.run)”)

If you tell me your VPS provider (Hetzner/DigitalOcean/etc) + what SSH user you’re using (root/ubuntu/etc) + the ssh -v snippet around the failure, I can point to the exact fix.

brittle hollow
#

I'm trying to set up an OpenClaw Gateway on my local machine (running Ubuntu/Linux).

What I tried:

  1. npm install -g openclaw - Installation seemed to work
  2. Tried openclaw gateway start - Command not found
  3. Tried with full path /home/aivora/.npm-global/bin/openclaw-BwRujSg0 gateway start - File not found error
  4. Reinstalled with npm uninstall -g openclaw and npm install -g openclaw again
  5. Still getting "command not found" when trying to run it

What I'm trying to do:
Set up a Gateway on my local machine so I can run remote commands on my VPS via the OpenClaw agent.

Questions:

β€’ How do I properly install and run openclaw gateway start?
β€’ Do I need to set up the PATH differently?
β€’ Should I use a different installation method?

My setup:

β€’ Machine: Linux (aivora-bot-01)
β€’ Node: v22.22.0
β€’ NPM: latest

next flareBOT
#

openclaw gateway start is a valid command β€” your issue is simpler: your shell can’t find the openclaw executable (PATH / npm prefix / nvm mismatch).

0) First: confirm the install actually produced a binary

Run these on your Ubuntu box and paste the output:

node -v
npm -v
npm config get prefix
ls -la "$(npm config get prefix)/bin" | grep -E "openclaw|clawdbot" || true
echo "$PATH" | tr ':' '\n' | sed -n '1,20p'
which openclaw || true

What we’re looking for:

  • $(npm config get prefix)/bin/openclaw exists
  • that .../bin folder is on your $PATH
#

1) Fix: add npm’s global bin to PATH

If your prefix is /home/aivora/.npm-global, then you need this in ~/.bashrc (or ~/.zshrc):

export PATH="$HOME/.npm-global/bin:$PATH"

Then reload:

source ~/.bashrc

After that, openclaw --version should work.

If your npm config get prefix is something else, use that:
export PATH="$(npm config get prefix)/bin:$PATH"

#

2) If you’re using nvm (common on Linux)

Make sure you install OpenClaw under the same Node version you actually run:

nvm use 22
npm install -g openclaw
hash -r
which openclaw
openclaw --version

3) Recommended install method (avoids PATH pain)

The docs recommend the installer + onboarding wizard (it also helps with daemon/service setup):

curl -fsSL https://openclaw.ai/install.sh | bash
#
openclaw onboard --install-daemon

Docs: https://docs.openclaw.ai/help/faq#whats-the-recommended-way-to-install-and-set-up-openclaw

4) Important: β€œrun commands on my VPS”

Even after you fix the install: a Gateway on your PC runs exec on your PC, not via SSH to your VPS.

To run commands on the VPS, you generally want either:

  • Gateway on the VPS, or
  • VPS as a node host (requires connectivity back to the Gateway; SSH-only setups usually need a tunnel or Tailscale)

Nodes overview: https://docs.openclaw.ai/nodes
Remote gateway model: https://docs.openclaw.ai/gateway/remote


#

Send the outputs from step 0 (especially npm config get prefix + the ls .../bin + PATH) and I’ll tell you the exact one-liner fix for your setup.

brittle hollow
#

My OpenClaw sandbox is broken and blocking ALL exec commands. Every command fails with this error:

Cannot find module '/home/aivora/.npm-global/lib/node_modules/openclaw/dist/tool-loop-detection-B1_rZFTj.js'
imported from /home/aivora/.npm-global/lib/node_modules/openclaw/dist/reply-Deht_wOB.js

What I tried:

β€’ npm uninstall -g openclaw
β€’ npm cache clean --force
β€’ rm -rf ~/.npm-global/lib/node_modules/openclaw
β€’ Fresh install with curl -fsSL https://openclaw.ai/install.sh | bash

Problem: Even after uninstalling, the sandbox keeps trying to load the corrupted module on EVERY command, blocking all work.

Question: How do I completely reset the sandbox environment or fix the module resolution? I have a Gateway running on my VPS (134.122.72.75:18789) and need the sandbox to connect to it for remote work.

next flareBOT
#

That error isn’t β€œthe sandbox” or remote-mode config β€” it’s your local OpenClaw code install being corrupt/incomplete.

reply-….js is trying to import "./tool-loop-detection-….js" from the same dist/ folder, but that chunk file isn’t there. Until that’s fixed, every command will crash before it can do anything (including connecting to your VPS gateway).

1) First, prove which openclaw you’re actually running

On your Ubuntu PC, run and paste output:

which -a openclaw || true
command -v openclaw || true
npm config get prefix
ls -la "$(npm config get prefix)/bin" | grep -E "openclaw" || true
ls -la "$(npm config get prefix)/lib/node_modules" | grep -E "openclaw|\\.openclaw-" || true

This often reveals you have multiple installs (or a leftover .openclaw-* staging dir) and your PATH is picking the broken one.

#

2) Hard reset the code install (not your gateway state)

Use your npm prefix (you already have it: ~/.npm-global), then nuke the binaries + module folders and reinstall:

PREFIX="$(npm config get prefix)"

npm uninstall -g openclaw || true

# remove any leftover installs/staging dirs
rm -rf "$PREFIX/lib/node_modules/openclaw" "$PREFIX/lib/node_modules/.openclaw-"* 2>/dev/null || true

# remove any leftover bin shims
rm -f "$PREFIX/bin/openclaw" "$PREFIX/bin/openclaw-"* 2>/dev/null || true

npm cache verify || npm cache clean --force
npm install -g openclaw@latest --force
#

hash -r
openclaw --version

After reinstall, sanity check that the missing file exists:

ls -la "$PREFIX/lib/node_modules/openclaw/dist" | grep tool-loop-detection || true

If that grep still shows nothing, it’s either:

  • you’re not executing the install you think you are (PATH mismatch), or
  • the install is failing mid-way (disk full / permissions / interrupted).

3) If you want the most robust install: β€œhackable (git) install”

#

This avoids weird global npm packaging/state issues:

curl -fsSL https://openclaw.ai/install.sh | bash -s -- --install-method git

Docs recommend this when debugging local issues:
https://docs.openclaw.ai/help/faq#im-stuck-whats-the-fastest-way-to-get-unstuck

4) Once local CLI works: connect your PC to the VPS Gateway (SSH-only)

Docs: https://docs.openclaw.ai/gateway/remote

If the gateway on the VPS is loopback-bound (recommended), do an SSH tunnel from your PC:

ssh -N -L 18789:127.0.0.1:18789 user@134.122.72.75
#

Then set remote mode on your PC:

openclaw config set gateway.mode remote
openclaw config set gateway.remote.url "ws://127.0.0.1:18789"
openclaw config set gateway.remote.token "<gateway-token>"

(Get the token on the VPS: openclaw config get gateway.auth.token.)


If you paste the output from step (1), I can tell you exactly where the β€œghost” install is coming from (wrong prefix / duplicate binary / leftover .openclaw-* folder / PATH picking the wrong one).

brittle hollow
#

salesbot@aivora-bot-01:~/sales-coach-phase1$ ssh -N -L 18789:127.0.0.1:18789 salesbot@134.122.72.75
salesbot@134.122.72.75's password:
bind [127.0.0.1]:18789: Address already in use
channel_setup_fwd_listener_tcpip: cannot listen to port: 18789
Could not request local forwarding.
openclaw config set gateway.mode remote
openclaw config set gateway.remote.url "ws://127.0.0.1:18789"
openclaw config set gateway.remote.token "<gateway-token>"
^Csalesbot@aivora-bot-01:~/sales-coach-phase1$ openclaw config set gateway.mode remote

openclaw config set gateway.remote.token "<gateway-token>"openclaw: command not found
salesbot@aivora-bot-01:~/sales-coach-phase1$ openclaw config set gateway.remote.url "ws://127.0.0.1:18789"
openclaw: command not found
salesbot@aivora-bot-01:~/sales-coach-phase1$ openclaw config set gateway.remote.token "<gateway-token>"
openclaw: command not found

next flareBOT
#

You’ve actually got two separate problems in that paste:

  1. Your SSH tunnel failed because your local port 18789 is already in use.
  2. Your OpenClaw CLI still isn’t installed / not on PATH (openclaw: command not found), so none of the config commands can run anyway.

Let’s fix them in the right order.


A) Fix the SSH tunnel: pick a free local port

bind 127.0.0.1:18789: Address already in use means something on your PC is already listening on 18789 (often a local OpenClaw gateway).

1) See what’s using it:

sudo lsof -iTCP:18789 -sTCP:LISTEN -n -P
# or
#
ss -ltnp | grep 18789

2) Easiest: just tunnel to a different local port (18790)

ssh -N -L 18790:127.0.0.1:18789 salesbot@134.122.72.75

Then your β€œremote url” should be:

  • ws://127.0.0.1:18790

(You can leave the VPS side as 18789; only the local port changes.)


B) Fix openclaw: command not found (PATH / install)

#

Right now you cannot run OpenClaw locally at all.

Run:

node -v
npm -v
npm config get prefix
ls -la "$(npm config get prefix)/bin" | grep openclaw || true
echo "$PATH" | tr ':' '\n' | grep -E "npm|nvm|pnpm|local" || true

If $(npm config get prefix)/bin/openclaw exists, add it to PATH:

If your prefix is ~/.npm-global, do:

echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
#
hash -r
openclaw --version

If it does NOT exist, reinstall:

npm install -g openclaw@latest
hash -r
openclaw --version

C) Once openclaw works: point it at the tunneled VPS gateway

Assuming you tunneled local 18790 -> VPS 127.0.0.1:18789:

#
openclaw config set gateway.mode remote
openclaw config set gateway.remote.url "ws://127.0.0.1:18790"
openclaw config set gateway.remote.token "<gateway-token>"
openclaw status

(You can also skip config and just run openclaw status --url ws://127.0.0.1:18790 --token ... once you have the CLI.)

Docs (remote mode): https://docs.openclaw.ai/gateway/remote


Quick question

Do you currently have a local OpenClaw gateway running on your PC? (That would explain why port 18789 is in use.)

If you paste the output of:

#
ss -ltnp | grep 18789
npm config get prefix
ls -la "$(npm config get prefix)/bin" | grep openclaw

…I’ll tell you exactly what to kill / what PATH line you need.

brittle hollow
#

the sandbox environment is broken.
when i ask the bot to make change he answer with this.
sandbox environment is broken in a way I can't fix from within it.
till me the exact steps to give him access to sandbox

next flareBOT
#

You can’t β€œgive the bot access to the sandbox” from inside chat.

In OpenClaw:

  • Sandbox = optional Docker isolation for tool execution (it reduces access).
  • Access to run shell commands is controlled by:
    1. tool allow/deny policy, and
    2. exec approvals on the machine that will actually execute (gateway host or node host).

That β€œsandbox environment is broken…” message usually happens when the agent is trying to run exec in host=sandbox but sandboxing isn’t set up (or is disabled), so it fails closed.

Do this on the machine where the Gateway runs (your VPS)

SSH into the VPS manually (normal SSH), then:

1) Point exec at the real host (not sandbox)

If you want commands to run on the VPS itself, set:

#
openclaw config set tools.exec.host gateway
openclaw config set tools.exec.security allowlist
openclaw config set tools.exec.ask on-miss
openclaw gateway restart

(Exec tool docs: https://docs.openclaw.ai/tools/exec)

2) Allow the commands via exec approvals (this is the β€œpermission” part)

On the VPS, add allowlist entries for the binaries you want the agent to use:

openclaw approvals get --gateway
openclaw approvals allowlist add --gateway --agent main "/usr/bin/ls"
openclaw approvals allowlist add --gateway --agent main "/usr/bin/git"
#
openclaw approvals allowlist add --gateway --agent main "/usr/bin/systemctl"

Approvals docs: https://docs.openclaw.ai/tools/exec-approvals
Approvals CLI: https://docs.openclaw.ai/cli/approvals

After this, exec on the VPS will work for allowlisted commands (and will prompt/deny for the rest depending on your approvals settings).

3) (Optional) If you actually want sandboxing

Sandboxing is separate. On the VPS:

cd <your openclaw git checkout>
scripts/sandbox-setup.sh
#

Then set agents.defaults.sandbox.mode in config. Full doc: https://docs.openclaw.ai/gateway/sandboxing
But again: sandboxing does not give more access; it isolates.


Quick question (so I don’t send you down the wrong path)

When you ask β€œmake change”, do you want the command to run:

  1. on the VPS (same host as the Gateway), or
  2. on your PC (Gateway on VPS, but you want a local node to run commands)?

Your earlier setup sounded like (1), so the steps above should fix it. If you want (2), you need a node host on your PC and set tools.exec.host=node.

brittle hollow
#

ivora@aivora-bot-01:~$ openclaw config set tools.exec.host gateway
openclaw: command not found
aivora@aivora-bot-01:~$ openclaw config set tools.exec.security allowlist
openclaw: command not found
aivora@aivora-bot-01:~$ openclaw config set tools.exec.ask on-miss
openclaw: command not found
aivora@aivora-bot-01:~$

next flareBOT
#

Yeah β€” you’re blocked one level earlier: OpenClaw isn’t installed / isn’t on PATH on that machine (openclaw: command not found). Until that’s fixed, you can’t change exec settings or approvals.

Here are the exact steps to get openclaw working on aivora-bot-01 (Ubuntu), then give it β€œsandbox/exec access” (really: host exec access).


1) Install OpenClaw (recommended way)

On aivora-bot-01 run:

curl -fsSL https://openclaw.ai/install.sh | bash

Then open a new shell (or reload your profile):

#
source ~/.profile 2>/dev/null || true
source ~/.bashrc 2>/dev/null || true
hash -r

Check it:

command -v openclaw
openclaw --version

If command -v openclaw prints a path and --version works, you’re good.

If it STILL says β€œcommand not found”

Your npm global bin isn’t on PATH. Find the prefix:

#
npm config get prefix

Then add …/bin to PATH. Example (common case):

echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
hash -r
command -v openclaw
openclaw --version

2) Now β€œgive the agent access” to run shell on the VPS host

#

This is not sandbox access β€” it’s configuring exec to run on the gateway host with approvals.

Run on the machine where the Gateway runs (if your gateway is on the VPS, run these there; if your gateway is on this Ubuntu box, run them here):

openclaw config set tools.exec.host gateway
openclaw config set tools.exec.security allowlist
openclaw config set tools.exec.ask on-miss
openclaw gateway restart

Then allow some safe basics:

openclaw approvals allowlist add --gateway --agent main "/usr/bin/ls"
openclaw approvals allowlist add --gateway --agent main "/usr/bin/uname"
#
openclaw approvals allowlist add --gateway --agent main "/usr/bin/uptime"

Docs:


3) One important clarification

Are you running these commands on your PC (aivora-bot-01) or on the VPS?

Because:

  • If your Gateway is on the VPS, you must run the config/approvals commands on the VPS (that’s where the agent β€œlives”).
  • If your Gateway is on your PC, run them on your PC.
#

Reply with:

  1. output of hostname and openclaw --version (once installed)
  2. where the Gateway is running (PC or VPS)
brittle hollow
#

aivora@aivora-bot-01:~$ curl -fsSL https://openclaw.ai/install.sh | bash

🦞 OpenClaw Installer
I can run local, remote, or purely on vibesβ€”results may vary with DNS.

βœ“ Detected: linux

Install plan
OS: linux
Install method: npm
Requested version: latest

[1/3] Preparing environment
βœ“ Node.js v22.22.0 found
Β· Active Node.js: v22.22.0 (/usr/bin/node)
Β· Active npm: 10.9.4 (/usr/bin/npm)

[2/3] Installing OpenClaw
βœ“ Git already installed
Β· Installing OpenClaw v2026.2.26
main: line 638: 393425 Killed "${cmd[@]}" > "$log" 2>&1
! 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.W9THq09sB8
! npm install failed; showing last log lines
! npm install failed; retrying
main: line 638: 393547 Killed "${cmd[@]}" > "$log" 2>&1
! 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.8O0BrVwX0m
! npm install failed; showing last log lines

next flareBOT
#

That Killed during npm install -g openclaw@latest is almost always the Linux OOM killer (the kernel killed the npm/node process because the machine ran out of RAM). That also explains your earlier β€œmissing dist/*.js chunk” errors β€” a half-installed package leaves broken dist/ output.

1) Confirm it’s OOM (on aivora-bot-01)

Run:

free -h
dmesg -T | egrep -i "killed process|oom" | tail -30

If you see Out of memory / Killed process node, that’s it.


2) Add swap (quick fix) and retry install

If you have sudo:

#
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
free -h

Now retry:

curl -fsSL https://openclaw.ai/install.sh | bash

#

3) Clean up any broken partial install (important)

After an OOM-killed install, remove leftovers before retrying:

PREFIX="$(npm config get prefix)"
rm -rf "$PREFIX/lib/node_modules/openclaw" "$PREFIX/lib/node_modules/.openclaw-"* 2>/dev/null || true
rm -f  "$PREFIX/bin/openclaw" "$PREFIX/bin/openclaw-"* 2>/dev/null || true
npm cache clean --force

Then reinstall (either the installer again, or):

npm install -g openclaw@latest

#

4) After it installs, verify:

command -v openclaw
openclaw --version

FYI on β€œgiving the bot sandbox access”

Sandboxing doesn’t β€œgive access” β€” it restricts access. If your goal is β€œrun shell commands”, you want exec on gateway/node host (with approvals), not β€œmore sandbox”.

But first you need a working openclaw binary, and right now you’re being killed mid-install due to low memory.

If you paste free -h (and whether you have sudo), I can tell you how much swap you’ll need / whether you should just upgrade RAM.

brittle hollow
#

aivora@aivora-bot-01:~$ free -h
total used free shared buff/cache available
Mem: 1.9Gi 697Mi 1.1Gi 4.0Mi 158Mi 1.1Gi
Swap: 0B 0B 0B
aivora@aivora-bot-01:~$ dmesg -T | egrep -i "killed process|oom" | tail -30
dmesg: read kernel buffer failed: Operation not permitted

next flareBOT
#

Yep β€” 1.9β€―GiB RAM and no swap is exactly the kind of box where npm install -g openclaw can get OOM-killed. And the dmesg permission error just means you’re not root, so you can’t read kernel logs.

What to do

Option 1 (best): add swap, then reinstall

If you have sudo, do this:

sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
free -h

(Optional: make it permanent)

#
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Now clean the partial install + retry:

PREFIX="$(npm config get prefix)"

sudo rm -rf "$PREFIX/lib/node_modules/openclaw" "$PREFIX/lib/node_modules/.openclaw-"* 2>/dev/null || true
sudo rm -f  "$PREFIX/bin/openclaw" "$PREFIX/bin/openclaw-"* 2>/dev/null || true

npm cache clean --force
curl -fsSL https://openclaw.ai/install.sh | bash

Then verify:

#
command -v openclaw
openclaw --version

Option 2: upgrade the machine

If you can bump this host to 4GB RAM, installs and builds get dramatically less painful.

Option 3: if you don’t have sudo

Then you can’t add swap. Your choices are basically:

  • run OpenClaw on a bigger machine (or your VPS), or
  • ask your admin to add swap.

After install succeeds (important)

To let the agent run commands on the VPS host, you’ll want exec on the gateway host with approvals (not β€œmore sandbox”). We can do that next, but first we need a working install.

#

Quick question: do you have sudo on aivora-bot-01? If yes, run the swap commands above and retry install. If no, tell me and we’ll switch to β€œrun Gateway on the VPS” as the main path.

brittle hollow
#

Onboarding complete. Use the dashboard link above to control OpenClaw.

aivora@aivora-bot-01:~$ command -v openclaw
/home/aivora/.npm-global/bin/openclaw
aivora@aivora-bot-01:~$ openclaw --version
2026.2.26
aivora@aivora-bot-01:~$

now the bot not answering in telegram

next flareBOT
#

Nice β€” OpenClaw is installed and the Gateway onboarded. If Telegram isn’t answering, it’s almost always one of these:

  1. Gateway isn’t actually running / reachable
  2. Telegram channel isn’t enabled / bot token is wrong
  3. Access control is blocking replies (pairing / allowFrom / group mention gating)
  4. It’s erroring in the background (you’ll see it in logs)

Here’s the fastest debug path.

1) Confirm the gateway is up and healthy

On aivora-bot-01:

openclaw status
openclaw gateway status
openclaw models status
#

If any of those show errors, paste the output.

2) Tail logs while you message the bot

Run this in one terminal:

openclaw logs --follow

Then in Telegram send your bot a DM like: ping

What we need to know:

  • Do you see the incoming Telegram update in logs?
  • If yes: do you see an error when it tries to reply?

(If nothing shows up in logs when you DM the bot, it’s almost certainly token/config/enabled.)

#

3) Check Telegram config + access policy

Show your Telegram config:

openclaw config get channels.telegram

Pay attention to:

  • enabled: true
  • botToken set
  • dmPolicy

Common gotchas:

  • dmPolicy = "pairing" (default): you must DM the bot and complete pairing (it should send a pairing code / instructions).
  • allowFrom: must be your numeric Telegram user id (not username). Docs: https://docs.openclaw.ai/help/faq#telegram-what-goes-in-allowfrom
  • Group chats: by default many setups require a mention in groups; test in a DM first.
#

4) If Telegram is configured but still silent

Run:

openclaw status --all

That’s designed to be pasteable/safe (tokens redacted) and usually contains the clue.


Reply with:

  1. Are you testing in DM or a group?
  2. Output of openclaw status and the last ~30 lines from openclaw logs --follow after you send β€œping”.
brittle hollow
#

Channels
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Channel β”‚ Enabled β”‚ State β”‚ Detail β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Telegram β”‚ ON β”‚ OK β”‚ token config (sha256:790fea85 Β· len 46) Β· accounts 1/1 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Telegram accounts
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Account β”‚ Status β”‚ Notes β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ default β”‚ OK β”‚ token:config β”‚

Agents
β”‚ Agent β”‚ Bootstrap file β”‚ Sessions β”‚ Active β”‚ Store β”‚

β”‚ main β”‚ ABSENT β”‚ 2 β”‚ 15m ago β”‚ ~/.openclaw/agents/main/sessions/sessions.json β”‚
β””

Diagnosis (read-only)

Gateway connection details:
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Config: /home/aivora/.openclaw/openclaw.json
Bind: loopback
βœ“ Config: /home/aivora/.openclaw/openclaw.json
βœ“ Restart sentinel: none
βœ“ Port 18789
! Tailscale: off Β· unknown
error: Error: spawn tailscale ENOENT
βœ“ Skills: 7 eligible Β· 0 missing Β· /home/aivora/.openclaw/workspace
! Channel issues skipped (gateway unreachable)
Gateway health:
connect failed: connect ECONNREFUSED 127.0.0.1:18789
Pasteable debug report. Auth tokens redacted.

next flareBOT
#

Your Telegram config is fine β€” the Gateway itself isn’t running.

Key line:

Gateway health: connect failed: connect ECONNREFUSED 127.0.0.1:18789
Channel issues skipped (gateway unreachable)

So Telegram can’t reply because there’s no gateway process listening on 127.0.0.1:18789.

1) Start / restart the Gateway service

Run:

openclaw gateway status
openclaw gateway start
#

If it says it’s already running but still refused, do:

openclaw gateway restart

2) If gateway start fails, check logs

openclaw logs --follow

(You should see why it didn’t bind the port β€” common causes are: config error, another process on the port, or the service wasn’t installed.)

3) Check if something else is using the port

ss -ltnp | grep 18789 || true
#

If you see another process bound to 18789, paste that line.

4) If you want it to run in the background (recommended)

Install the daemon/service:

openclaw onboard --install-daemon
# or if already installed:
openclaw gateway install --force
openclaw gateway restart

Once openclaw status shows Gateway health OK, your Telegram bot will start answering immediately.

Paste the output of openclaw gateway status if it still won’t start.

brittle hollow
#

Onboarding complete. but the bot in telegram send this: HTTP 401: authentication_error: invalid x-api-key (request_id: req_011CYdPbXkfMQKpc32uWGjsk)

next flareBOT
#

That HTTP 401 invalid x-api-key is not Telegram auth β€” it’s your LLM provider auth (almost certainly Anthropic, because Anthropic uses the x-api-key header).

So the Gateway is receiving your Telegram message, but when it tries to call the model, the provider rejects the key/token.

Fix checklist (do these on the Gateway host)

1) See what model/provider you’re actually using + what auth profile is picked

openclaw models status

Paste the anthropic section (it’ll redact secrets).

2) Re-auth Anthropic (pick ONE path)

A) If you have an Anthropic API key

#
openclaw models auth paste-token --provider anthropic
# paste your real Anthropic API key when prompted
openclaw gateway restart

B) If you’re using Claude Pro/Max subscription (setup-token)
Generate a setup-token via Claude Code (on any machine):

claude setup-token

Then on the Gateway host:

openclaw models auth paste-token --provider anthropic
# paste the setup-token
openclaw gateway restart
#

(FAQ section on setup-token auth is in the docs: https://docs.openclaw.ai/help/faq.md β†’ β€œHow does Anthropic setup-token auth work”)

3) Make sure you’re not accidentally overriding it with a bad env var

In the same shell you run OpenClaw from:

env | grep -i anthropic || true

If you see ANTHROPIC_API_KEY set to something stale/wrong, unset it and restart the gateway.


If you paste the output of openclaw models status (just that), I can tell you exactly what it’s trying to use (provider + profile) and what to change.

brittle hollow
#

the bot is back now.
how i check now if he can accesee the terminal and run comands?

next flareBOT
#

Good β€” now test exec explicitly.

1) Fast test from chat (Telegram)

Send the bot:

/exec

It should reply with the current exec defaults (host/security/ask).
Then try a harmless command:

run `uname -a`

(or β€œrun pwd”, β€œrun ls -la”).

#

2) If it says it can’t / denies / asks for approval

That means exec approvals / allowlist are blocking it (normal).

On the gateway host, check what exec is configured to do:

openclaw config get tools.exec
openclaw approvals get --gateway

Allow a safe command (example)

openclaw approvals allowlist add --gateway --agent main "/usr/bin/uname"
openclaw approvals allowlist add --gateway --agent main "/bin/ls"
openclaw gateway restart
#

Docs for how exec/approvals work:

3) Confirm where it’s running (important)

Remember:

  • If your Gateway is on your PC, exec runs on your PC.
  • If your Gateway is on the VPS, exec runs on the VPS.
  • OpenClaw doesn’t SSH into other machines unless you set up a node host.

If you tell me where your Gateway is running (PC or VPS), I’ll give the exact β€œbest practice” exec settings for that setup.

brittle hollow
#

Current exec defaults: host=sandbox, security=deny, ask=on-miss, node=(unset).
Options: host=sandbox|gateway|node, security=deny|allowlist|full, ask=off|on-miss|always, node=<id>.

next flareBOT
#

That output means: right now the bot cannot run any commands anywhere.

  • host=sandbox = try to run inside the sandbox container
  • security=deny = block all exec (even if sandbox exists)
    So exec is effectively disabled.

You have two ways to enable it:

Option A (recommended): run commands on the Gateway host with allowlist + approvals

On the machine where your Gateway runs:

openclaw config set tools.exec.host gateway
openclaw config set tools.exec.security allowlist
openclaw config set tools.exec.ask on-miss
openclaw gateway restart
#

Then allow a couple safe binaries (still on the gateway host):

openclaw approvals allowlist add --gateway --agent main "/usr/bin/uname"
openclaw approvals allowlist add --gateway --agent main "/bin/ls"

Now in Telegram you can test:

  • run uname -a
  • run ls -la

Docs: https://docs.openclaw.ai/tools/exec and https://docs.openclaw.ai/tools/exec-approvals

Option B (quick β€œbreak glass”): full exec (not recommended long-term)

This removes safety rails: