Skip to content

Instantly share code, notes, and snippets.

@MarcoDotIO
Created April 16, 2026 04:00
Show Gist options
  • Select an option

  • Save MarcoDotIO/ddbace73671d6b0b5d2cd1002ecebf46 to your computer and use it in GitHub Desktop.

Select an option

Save MarcoDotIO/ddbace73671d6b0b5d2cd1002ecebf46 to your computer and use it in GitHub Desktop.
OpenClaw Installation (Ubuntu 24.04)
#!/usr/bin/env bash
set -euo pipefail
echo "=== OpenClaw install + local daemon + Codex OAuth setup (Ubuntu 24.04) ==="
# --- OS check ---
if ! grep -q 'VERSION_ID="24.04"' /etc/os-release; then
echo "ERROR: This script is intended for Ubuntu 24.04."
exit 1
fi
# --- Prereqs ---
sudo apt update
sudo apt install -y curl ca-certificates openssl
# --- Install OpenClaw without auto-onboarding ---
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard
# --- Ensure openclaw is on PATH ---
if ! command -v openclaw >/dev/null 2>&1; then
if command -v npm >/dev/null 2>&1; then
export PATH="$(npm prefix -g)/bin:$PATH"
hash -r
fi
fi
if ! command -v openclaw >/dev/null 2>&1; then
echo "ERROR: openclaw is not on PATH after install."
echo 'Try: export PATH="$(npm prefix -g)/bin:$PATH"'
exit 1
fi
echo "Installed:"
openclaw --version
# --- Quickstart-style non-interactive local setup ---
# We intentionally skip provider auth here, then do Codex OAuth directly.
OPENCLAW_GATEWAY_TOKEN="${OPENCLAW_GATEWAY_TOKEN:-$(openssl rand -hex 24)}"
openclaw onboard \
--non-interactive \
--accept-risk \
--mode local \
--flow quickstart \
--auth-choice skip \
--gateway-auth token \
--gateway-token "${OPENCLAW_GATEWAY_TOKEN}" \
--gateway-port 18789 \
--gateway-bind loopback \
--install-daemon \
--daemon-runtime node \
--skip-skills \
--skip-search \
--json
# --- Verify gateway/service ---
echo
echo "Gateway status:"
openclaw gateway status || true
# --- Codex OAuth login ---
echo
echo "=============================================================="
echo "Next step requires user interaction."
echo "A browser-based OpenAI Codex OAuth flow will start."
echo "Sign in, then paste the returned code#state value if prompted."
echo "=============================================================="
echo
openclaw models auth login --provider openai-codex
# --- Set default model explicitly to Codex GPT-5.4 ---
openclaw config set agents.defaults.model.primary openai-codex/gpt-5.4
echo
echo "Final model/auth status:"
openclaw models status || true
echo
echo "Done."
echo "Gateway token:"
echo " ${OPENCLAW_GATEWAY_TOKEN}"
echo
echo "Useful commands:"
echo " openclaw gateway status"
echo " openclaw models status"
echo " openclaw dashboard"
echo " openclaw logs --follow"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment