1. Introduction: Why Are These Two Tools Essential for Ubuntu Users?
For users of the Ubuntu Linux system, whether you plan to install the OpenClaw tool, engage in front-end development, run projects, or set up a development environment, Node.js and Git are two indispensable core tools. They are like the “key to the door” for subsequent operations, and neither can be dispensed with.
However, in reality, 80% of beginners will encounter problems when installing these two tools—either installing the wrong version leading to unusability, encountering errors when executing commands after installation, or even being unsure whether they have actually installed them successfully.
Especially if you want to install OpenClaw, you must first configure Node.js and Git properly; otherwise, the subsequent installation will fail directly. Today, this detailed guide will take you step by step to complete the installation in one go with the simplest commands and the most reliable methods, without detours or unnecessary words, making it easy for beginners to get started.
2. Preparation – Open the Ubuntu Terminal and Adjust the Comfortable Operating Environment
Before installation, we need to open the Ubuntu terminal, which is the basis for executing all installation commands. Many beginners find the font too small when they first open the terminal, which affects operation, so we first adjust the environment. The specific steps are as follows:
- Log in to the Ubuntu Linux system and enter the desktop interface (ensure the system is running normally without abnormal errors).
- Right-click on an empty space on the desktop, and select “Open in Terminal” from the pop-up menu. A terminal window will pop up at this time.
- If you find the terminal font too small, click the three horizontal lines (menu button) in the upper right corner of the terminal window.
- Find the percentage icon related to “font size adjustment” in the menu (the icon style varies slightly in different Ubuntu versions, but the function is the same).
- Drag the adjustment slider or click the percentage to adjust the font to a size that you find comfortable, then close the menu.
3. Preliminary Check – Confirm Whether Node.js and Git Are Installed on the System
Before starting the installation, we need to confirm whether Node.js and Git are already installed on the system to avoid duplicate installation or version conflicts. This step is very simple, just execute two commands. The specific steps are as follows:
- Enter the command in the terminal: node -v, then press Enter.
- If the terminal displays “command not found: node“, it means Node.js is not installed on the system. At the same time, the terminal may prompt a default installation command. We will not execute this command for the time being and continue to check Git.
- Enter the command in the terminal: git -v, then press Enter.
- If the terminal also displays “command not found: git“, it means Git is not installed on the system. At this time, our system is in a “clean” state, and we can start the subsequent installation operations.
- If one of the tools is already installed, you can judge whether it meets the requirements for subsequent use through the version number displayed by the command (especially Node.js, which needs to meet the version requirements of OpenClaw).
4. Install Node.js – Avoid Version Pitfalls and Adapt to OpenClaw Requirements
The installation of Node.js is the key because OpenClaw has clear requirements for its version (requires Node.js 22+ version), while the version installed by the default Ubuntu source is often too low to meet the requirements. Therefore, we need to complete it in two steps: first install the basic version, then upgrade to the version that meets the requirements. The specific steps are as follows:
- Install the basic version of Node.js: Enter the command sudo apt install nodejs in the terminal and press Enter.
- At this time, the terminal will prompt you to enter the system password (no characters will be displayed when entering the password, just enter it normally), and press Enter after entering.
- The terminal will prompt you to confirm the installation. Enter “y” (which means yes), press Enter, and the system will start installing Node.js automatically.
- Wait for 1-2 minutes. After the installation is complete, enter the command node -v to verify the version. At this time, the terminal will display the version number (such as v20.19.4), which is lower than the 22+ required by OpenClaw and needs to be further upgraded.
- Upgrade Node.js to version 22+: First, you need to execute the upgrade source command, but at this time you will encounter the problem of “missing curl command“. So first install the curl tool, enter the command sudo apt install curl, press Enter, enter the password and confirm (enter y) to complete the curl installation.
- After installing curl, enter the upgrade source command: curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash –, press Enter, and the system will automatically download the source file of Node.js 22+ version.
- After the source file is downloaded, enter the command sudo apt-get install -y nodejs, press Enter, and the system will start upgrading Node.js.
- After the upgrade is complete, enter node -v again to verify the version. At this time, the terminal will display the 22+ version (such as v22.22.1), indicating that Node.js has been installed and upgraded successfully, which can meet the usage requirements of OpenClaw.
5. Install Git – Simple Operation, No Complex Configuration
Unlike Node.js, OpenClaw has no strict requirements on the version of Git. As long as you install the latest stable version, the installation process is very simple. The specific steps are as follows:
- Enter the command in the terminal: sudo apt install git, press Enter.
- Enter the system password, press Enter, then enter “y” to confirm the installation, and the system will start installing Git automatically.
- Wait for about 1 minute. After the installation is complete, enter the command git -v to verify the version. The terminal will display the currently installed Git version (such as 2.51.0).
- No additional configuration is required. At this time, Git has been installed and can be used directly, fully meeting the needs of OpenClaw and front-end development.
6. Final Verification – Confirm That Both Tools Can Work Normally
After the installation is complete, we need to verify again whether both tools can run normally to ensure that there will be no problems when installing OpenClaw or conducting front-end development later. The specific steps are as follows:
- Verify Node.js: Enter node -v in the terminal. If the 22+ version number is displayed, it means Node.js is running normally.
- Verify Git: Enter git -v in the terminal. If the normal version number is displayed, it means Git is running normally.
- If both commands can display the version number normally without any errors, it means Node.js and Git have all been installed successfully. At this time, you can directly install OpenClaw or perform subsequent front-end development and project operation.
7. Conclusion: The Key to Avoiding Pitfalls for Beginners, Complete the Basic Environment in Minutes
In fact, installing Node.js and Git on the Ubuntu system, the core is to avoid two pitfalls:
- One is the version problem of Node.js, which must be upgraded to 22+ to be compatible with OpenClaw;
- The other is the problem of missing curl command, which can be installed in advance to complete the upgrade smoothly.
The entire process only requires a few commands, the operation is simple, and it can be completed in a few minutes. No complex theoretical knowledge is needed, and beginners can succeed once.
If you encounter errors during the installation, you can leave a message in the comment area, and solutions for common problems will be provided later. After the installation is complete, you can smoothly install OpenClaw or conduct front-end development and start your Ubuntu usage journey!
8. Demo Video
You can watch the following demo video by select the subtitle to your preferred subtitle language.