#upgrading openclaw from git repo

1 messages · Page 1 of 1 (latest)

flint summit
#

i have openclaw installed on my VPS.
I first cloned and checked out the lastest version
and installed it (see script below on how i did that)

now i want to upgrade (here is what i think i should run):

cd /opt/openclaw
git pull --prune
git checkout -b v2026.3.2_branch v2026.3.2 >/dev/null || git checkout v2026.2.26_branch

openclaw --version
systemctl --user stop openclaw-gateway.service

pnpm install
pnpm build
pnpm ui:build

systemctl --user start openclaw-gateway.service
systemctl --user status openclaw-gateway.service
openclaw --version

this is my initial install script:

#!/usr/bin/env bash
set -euo pipefail

sudo dnf groupinstall -y "Development Tools"
sudo dnf install -y cmake lsof

sudo mkdir -p /opt/openclaw
sudo chown rocky:rocky /opt/openclaw
sudo chmod 750 /opt/openclaw

cd /opt/openclaw
if [ ! -d .git ]; then
  git clone https://github.com/openclaw/openclaw .
else
  git fetch --all --prune --tags
fi

# Use tag/branch as you like:
git checkout -b v2026.2.26_branch v2026.2.26 2>/dev/null || git checkout v2026.2.26_branch
git status --porcelain=v1
git rev-parse --short HEAD
git describe --tags --always || true

pnpm install
pnpm build
pnpm ui:build

# Install CLI wrapper
mkdir -p "$HOME/.local/bin"
cat > "$HOME/.local/bin/openclaw" <<'EOF'
#!/usr/bin/env bash
exec node /opt/openclaw/openclaw.mjs "$@"
EOF
chmod +x "$HOME/.local/bin/openclaw"

command -v openclaw
openclaw --version

# Gateway service install (user service)
openclaw gateway install

# Ensure it runs after reboot without login
sudo loginctl enable-linger rocky

systemctl --user daemon-reload
systemctl --user enable --now openclaw-gateway.service
systemctl --user status openclaw-gateway.service --no-pager


wary graniteBOT
#

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

crude coveBOT
#

Your overall upgrade flow is basically right (stop gateway → update code → rebuild → start gateway), but I’d tweak a few things to make it safer/repeatable.

Docs reference (worth skimming): https://docs.openclaw.ai/install/updating

Key fixes to your command list

1) Don’t rely on git pull for tags

If you’re updating to a tag (v2026.3.2), make sure you fetch tags:

git fetch --all --prune --tags

(git pull updates the current branch; it doesn’t reliably update tags the way people expect.)

2) Your checkout fallback looks wrong

You probably meant to fall back to the existing 2026.3.2 branch, not the old 2026.2.26 branch.

#

Also, git checkout -b ... fails if the branch already exists. Use -B to “create or reset”:

git checkout -B v2026.3.2_branch v2026.3.2

3) Run openclaw doctor after rebuilding

This catches config/service migrations and fixes “CLI vs service mismatch” cases.

Suggested “manual but solid” upgrade script

cd /opt/openclaw

# stop first (so you’re not swapping files under a running gateway)
systemctl --user stop openclaw-gateway.service
#

git fetch --all --prune --tags
git checkout -B v2026.3.2_branch v2026.3.2

pnpm install
pnpm build
pnpm ui:build

openclaw doctor

systemctl --user start openclaw-gateway.service

openclaw --version
openclaw gateway status
openclaw health
#

(You can replace the systemctl start/stop with openclaw gateway restart once you’re confident the service is installed and detected correctly.)

Even easier: let OpenClaw do it

If you’re on a source (git) install, the preferred path is usually just:

openclaw update

It’s basically the “safe-ish” automation of: git update + pnpm install/build/ui + doctor + restart.

If anything goes sideways

Paste these outputs (they redact tokens in the --all view):

openclaw --version
#
openclaw gateway status
openclaw status --all
journalctl --user -u openclaw-gateway.service -n 200 --no-pager
flint summit
#

okay; so when you run the simple:

openclaw update

does it pull the latest stable tag?
can yo specify the desired version?
does it pull the code so it us up-to-date with install

crude coveBOT
#

Yes — openclaw update is meant to be the “do the right thing” updater, and it does fetch/checkout/install so your code matches what you’re running (then rebuilds + runs doctor + restarts by default).

Does openclaw update pull the latest stable tag?

If you’re on a git/source install, then on the stable channel it will:

  • fetch tags
  • checkout the latest non--beta tag
  • pnpm install + pnpm build + pnpm ui:build
  • run openclaw doctor
  • restart the gateway (unless --no-restart)

This is explicitly documented here: https://docs.openclaw.ai/cli/update (see “Git checkout flow” → stable).

If you’re on an npm/pnpm global install (no git metadata), “stable” means “install from npm latest”.

Can you specify the desired version?

Yes — use --tag:

#
openclaw update --tag 2026.3.2

Per docs, --tag accepts an npm dist-tag or version. (So beta is valid too: openclaw update --tag beta.)

If what you want is specifically a git tag like v2026.3.2 in a particular repo path, you can still do it manually with git as you were doing — but for most people the --tag 2026.3.2 path is the easiest “pin”.

Does it pull code / keep it up-to-date with the install?

Yes — but it updates the install it thinks you’re using:

  • dev channel: uses a git checkout (default ~/openclaw, override with OPENCLAW_GIT_DIR)
  • stable/beta channels: aligns install method (npm vs git) to match the channel

To see what it will touch on your VPS, run:

#
openclaw update status
openclaw update --dry-run

Those two commands are the fastest way to confirm whether it’s targeting /opt/openclaw (your wrapper) or some other checkout.

flint summit
#

this worked great:

git fetch --all --prune --tags
git checkout -B v2026.3.2_branch v2026.3.2

openclaw update status
openclaw update --dry-run

openclaw --version
openclaw update --tag v2026.3.2
openclaw --version

openclaw gateway status
openclaw health

command -v openclaw
openclaw --version
node /opt/openclaw/openclaw.mjs --version

crude coveBOT
#

Perfect — that’s the cleanest way to do it.

Two quick “done-done” checks (just to be 100% sure the service is running the new bits too):

openclaw gateway status
openclaw health

If those look good, you’re all set.

If this thread is solved, please right-click the solution message → Apps → ✅ Mark Solution so Answer Overflow can index it for the next person.

flint summit
#

looks like the latest tag => v2026.3.2
is actually v2026.3.3

 openclaw --version
2026.3.3

crude coveBOT
#

Yep — that’s expected behavior.

On the stable channel, openclaw update does not try to keep you on the tag you manually checked out; it will move to the latest stable (non--beta) tag. Right now that appears to be v2026.3.3, hence:

openclaw --version
# 2026.3.3

If you want to stay pinned to 2026.3.2

Use an explicit version pin:

openclaw update --tag 2026.3.2

(or keep doing the manual git checkout + rebuild flow and just don’t run openclaw update afterward).

#

Also: double-check which openclaw you’re actually running

Because openclaw update can align installs, it’s worth verifying PATH:

command -v openclaw
openclaw --version
node /opt/openclaw/openclaw.mjs --version

If openclaw --version and node /opt/openclaw/openclaw.mjs --version ever differ, your shell/service is picking up a different CLI than your /opt/openclaw wrapper.