Install and run OpenClaw for the first time on any platform.
Install OpenClaw on macOS, Linux, or Windows and complete your first AI-assisted task in under 5 minutes.
Install OpenClaw on macOS, Linux, or Windows and complete your first AI-assisted task in under 5 minutes.
From zero to running in just 5 minutes.
Most "getting started" guides hide the actual installation command under several explanatory paragraphs. Ignore that part. Here's what you need and how to run it.
By the end of this lesson, you will have installed OpenClaw and be able to communicate with AI models.
Prerequisite: Node.js
OpenClaw requires Node.js version 22.14 or later (Node 24 recommended). Check if you have it installed:
node --version
If you see version v22.14.0 or higher, you're ready. If not, install it:
macOS:
brew install node
Linux (Ubuntu/Debian):
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash - sudo apt-get install -y nodejs
Windows: Download the installer from nodejs.org and run it. Select the LTS version.
✅ Quick check : Which command checks your Node.js version?
Answer : node --version
Install OpenClaw
One command:
npm install -g openclaw
This command installs the openclaw command system-wide. Verify that it is working:
openclaw --version
You will see the version number. If you get "command not found," your npm system-wide path is not in the PATH - run `npm config get prefix` and add that /bin directory to your shell configuration.
Initial setup process
This is an important order:
openclaw onboard --install-daemon
This command will launch the setup process, guiding you through the following steps:
- Gateway configuration - Where OpenClaw runs (local by default)
- Model validation - Connecting to an AI vendor (choose any vendor you have - we'll add more vendors in lessons 3-5)
- Setting up the workspace - Create the ~/.openclaw/ directory with your agent files.
- Daemon settings - Keep OpenClaw running in the background
- Optional channels - Telegram, Discord, WhatsApp (ignore these channels currently)
Follow the instructions. For the model provider, select the provider for which you already have an API key. If you don't have one yet, select "Skip" - we'll set them up in the following lessons.
Your first task
After the initial setup is complete, try this command:
openclaw chat
Then type:
Kiểm tra xem hàm này có lỗi không: function calculateTotal(items) { let total = 0; for (let i = 0; i <= items.length; i++) { total += items[i].price * items[i].quantity; } return total; }
OpenClaw will catch a one-unit deviation error (<= should be <). If it catches it, your setup is working.
Understanding the workspace
OpenClaw has created a workspace at ~/.openclaw/. Here is the content inside:
~/.openclaw/ ├── config.yaml # Cài đặt gateway và nhà cung cấp ├── workspace/ │ ├── SOUL.md # Tính cách agent của bạn (bài học 7) │ ├── AGENTS.md # Quy tắc hoạt động (bài học 7) │ ├── USER.md # Thông tin về bạn │ └── memory/ # Các file bộ nhớ dài hạn └── logs/ # Nhật ký phiên và việc sử dụng token
Don't edit these files right now – we'll customize them in Lesson 7. For now, just know they exist.
✅ Quick check : By default, where does OpenClaw store its workspace files?
Answer : ~/.openclaw/workspace/
Try it yourself.
Open the terminal and run these steps in this order:
# 1. Kiểm tra Node.js node --version # 2. Cài đặt OpenClaw npm install -g openclaw # 3. Xác minh cài đặt openclaw --version # 4. Chạy quá trình thiết lập ban đầu openclaw onboard --install-daemon # 5. Bắt đầu trò chuyện openclaw chat
If everything works, ask OpenClaw to explain the function of the files in ~/.openclaw/workspace/. It should describe SOUL.md, AGENTS.md, and the memory system—exactly what we'll learn in Lesson 7.
Troubleshooting
| Problem | Solution |
|---|---|
command not found: openclaw |
Add the system-wide npm bin directory to the PATH environment variable:export PATH="$(npm config get prefix)/bin:$PATH" |
| Access permission error on Linux | Use sudo npm install -g openclawor modify npm access permissions. |
| The integration process is stuck at "gateway". | Check if port 3000 is currently in use:lsof -i :3000 |
| "No model configured" | You skipped the step of adding a supplier - that's okay, we'll add suppliers in lessons 3-5. |
Key points to note
- OpenClaw requires Node.js 22.14 or later and is installed via the command `npm install -g openclaw`.
- The command `openclaw onboard --install-daemon` will handle all initial setup in a single guided process.
- Your workspace is located at `~/.openclaw/` and contains configuration files, agent files, and memory.
- You can start a chat immediately with OpenClaw Chat.
-
Question 1:
What is the minimum Node.js version required for OpenClaw?
EXPLAIN:
OpenClaw requires Node 22.14 or later; Node 24 is recommended for best performance.
-
Question 2:
What does the command 'openclaw onboard --install-daemon' do?
EXPLAIN:
The onboard command is a formal, guided setup that configures everything in a single session: port, model authentication, workspace directory, and optional messaging channels.
Training results
You have completed 0 questions.
-- / --
- Is OpenClaw right for you?
- Build custom OpenClaw skills
- OpenClaw (Clawdbot) User Guide: Control your PC from WhatsApp
- Using OpenClaw with Ollama: Building a local data analytics system.
- The AI Agent boom: Claude, OpenClaw, and a new era of automation.
- 'OpenClaw AI' and the emerging trend of compact digital assistants in China.