Skip to content

OpenClaw install guide (Linux / WSL2) ​

0. Prerequisite: Node.js 24.16+ (OpenClaw needs 24.16+ or 26.1+; Node 22 won't work) ​

Install Node.js first: Node.js on Linux

Heads-up: OpenClaw is picky about Node versions. Make sure you're on Node.js 24.16+ (or 26.1+) before you continue.

1. Install OpenClaw ​

Step 1: Open a terminal.

Step 2: Paste this command into the terminal and press Enter:

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

Step 3: Check the install. Run these two commands:

bash
openclaw --version
bash
openclaw doctor

If you see a version number and a health report, you're good.

2. Onboard ​

What's onboarding? Onboarding sets up OpenClaw as a background service on your machine, so you can use AI from the web panel or the command line.

Step 1: Run the onboarding command in the terminal:

bash
openclaw onboard --install-daemon

Step 2: Answer the prompts. If you're new, pick these:

  1. Onboarding mode: choose Manual

    • Use the ↑↓ arrow keys to move, Enter to confirm
  2. What do you want to set up?: choose Local gateway (this machine)

    • Runs the service on your own computer
  3. Gateway port: enter 18789, or just press Enter for the default

    • The port the service listens on; no need to change it
  4. Gateway auth: choose Token

    • Recommended; it keeps your gateway locked down

3. Configure OpenClaw (connect to Flash API) ​

3.1 Where's the config file? ​

Config path: ~/.openclaw/openclaw.json

What that means:

  • ~ is your home directory
  • The full path is /home/<your-username>/.openclaw/openclaw.json

3.2 Get your Flash API key ​

Step 1: Grab your API key from Flash API

  • No account yet? Sign up first
  • After logging in, find your API key in the dashboard and copy it

Step 2: Pick a token for local gateway auth

  • Anything works, e.g. my-secret-token-123
  • Remember it; you'll need it to open the gateway

3.3 Write the config file ​

Note: the commands below create the config file. Follow these steps:

Step 1: Create the config directory

bash
mkdir -p ~/.openclaw

Step 2: Write the config file (replace two values)

bash
cat > ~/.openclaw/openclaw.json <<'EOF'
{
  "agents": {
    "defaults": {
      "model": {
        "primary": "flashapi/gpt-6.1-sol"
      }
    }
  },
  "models": {
    "mode": "merge",
    "providers": {
      "flashapi": {
        "baseUrl": "https://ai.flashapi.top/v1",
        "apiKey": "YOUR_FLASH_API_KEY",
        "api": "openai-responses",
        "models": [
          { "id": "gpt-6.1-sol", "name": "GPT-6.1 Sol" },
          { "id": "claude-opus-5-5", "name": "Claude Opus 5.5" },
          { "id": "gemini-2.5-pro", "name": "Gemini 2.5 Pro" }
        ]
      }
    }
  },
  "gateway": {
    "mode": "local",
    "port": 18789,
    "auth": {
      "mode": "token",
      "token": "your-token"
    }
  }
}
EOF

Values you must replace:

  1. "apiKey": "YOUR_FLASH_API_KEY" → replace YOUR_FLASH_API_KEY with the real key you copied from Flash API
  2. "token": "your-token" → replace your-token with your own token (e.g. my-secret-token-123)

How to do it:

  1. Copy the whole command above
  2. Replace the two placeholders with your real values
  3. Paste it into the terminal and run it

3.4 What the config does (optional reading) ​

Default model:

  • "primary": "flashapi/gpt-6.1-sol" makes GPT-6.1 Sol the default
  • To default to Claude, change it to "primary": "flashapi/claude-opus-5-5"
  • To default to Gemini, change it to "primary": "flashapi/gemini-2.5-pro"

Available models: The config registers three models you can switch between:

  • gpt-6.1-sol: GPT-6.1 Sol (OpenAI's latest)
  • claude-opus-5-5: Claude Opus 5.5 (Anthropic)
  • gemini-2.5-pro: Gemini 2.5 Pro (Google)

Key settings:

  • "baseUrl": the Flash API endpoint. Leave it as is.
  • "api": "openai-responses": OpenAI-compatible format. Leave it as is.
  • "port": 18789: the local gateway port. Must match what you chose during onboarding.

4. Restart the gateway and verify ​

Restart the OpenClaw gateway so it loads the new config.

Step 1: Restart the gateway

bash
openclaw gateway restart

Step 2: Check the config

bash
openclaw doctor

Green ✓ marks mean you're set.

Step 3: Check the status

bash
openclaw status

Step 4: Open the web dashboard

bash
openclaw dashboard

It prints a URL (e.g. http://localhost:18789). Open it in your browser.

If it asks for a token:

  • Enter the token you set in the config file (e.g. my-secret-token-123)
  • You're in

5. Switching models ​

OpenClaw lets you switch models on the fly.

Option 1: from the web panel

  1. Open the URL printed by openclaw dashboard
  2. Find the model picker
  3. Pick a model (GPT-6.1 Sol, Claude Opus 5.5 or Gemini 2.5 Pro)

Option 2: change the default in the config file

  1. Open the config file ~/.openclaw/openclaw.json in a text editor
  2. Find the "primary" line
  3. Set it to the model you want:
    • GPT-6.1 Sol: "primary": "flashapi/gpt-6.1-sol"
    • Claude Opus 5.5: "primary": "flashapi/claude-opus-5-5"
    • Gemini 2.5 Pro: "primary": "flashapi/gemini-2.5-pro"
  4. Save, then run openclaw gateway restart

FAQ ​

1. "openclaw: command not found" ​

Cause: you haven't reopened the terminal since installing, or Node.js's global package path isn't on your PATH.

Fix:

  1. Close the terminal and open a new one
  2. Still nothing? Restart your computer
  3. Still nothing? Check that Node.js is installed correctly: node -v

2. Writing the config file fails ​

Cause: usually a permissions issue or a missing directory.

Fix:

  1. Create the directory manually: mkdir -p ~/.openclaw
  2. Run the config-writing command again

3. The gateway won't start ​

Cause: the port is taken, or the config file has a syntax error.

Fix:

  1. Check the config for syntax errors (especially quotes and commas)
  2. Make sure you replaced both the API key and the token
  3. Try a different port (e.g. 18790)

4. API calls fail ​

Cause: a wrong API key, or your Flash API balance has run out.

Fix:

  1. Check the key was copied correctly (no stray spaces)
  2. Log in to the dashboard and check your balance
  3. Make sure baseUrl is https://ai.flashapi.top/v1 (note the trailing /v1)

Next steps ​

With everything configured, you can:

  • Chat with AI in the web panel
  • Call AI from the command line
  • Integrate OpenClaw into your own projects

For more, see the official OpenClaw docs. Prefer zero manual steps? Try the OpenClaw one-line setup.

One base URL for GPT, Claude and Gemini