How to Install Claude Code CLI on Ubuntu

How to Install Claude Code CLI on Ubuntu
To install the official CLI of Claude Code on Ubuntu in the most efficient manner, you need to execute the command curl -fsSL https://claude.ai/install.sh | bash. The binary file will be downloaded without Node.js. In this article, we will explain the details of this procedure, the system requirements for it, the alternative with apt, and ways to check if the CLI has been installed successfully.
How do I install Claude Code on Ubuntu?
To install Claude Code on Ubuntu, one should run the official native installer with the following command curl -fsSL https://claude.ai/install.sh | bash. This way, one will download the binary file and configure auto-updating without using Node.js at all.
$ curl -fsSL https://claude.ai/install.sh | bash
According to the official setup documentation, this is marked as the "Recommended" method of installation, and native installations "automatically update in the background to keep you on the latest version" โ which is the main reason to prefer it over npm and Linux package manager unless one wants to have the control over updating time manually.
What are the system requirements for Claude Code on Ubuntu?
At least Ubuntu 20.04, 4 GB of RAM, x64 or ARM64 processor, and an internet connection are required to install Claude Code. The only exception is Node.js โ it is necessary only in case of npm installation.
Requirement | Minimum |
|---|---|
Ubuntu version | 20.04+ |
RAM | 4 GB+ |
CPU architecture | x64 or ARM64 |
Network | Internet connection required |
Node.js | Required for the npm install method only |
The same figures are mentioned in the setup documentation under the heading "System requirements", along with macOS, Windows, Debian, and Alpine OSes as the supported operating systems โ since Ubuntu 20.04 is the minimum version, the newest ones such as 22.04 and 24.04 are covered too.
How do I install Claude Code with apt instead?
To install Claude Code with apt, one needs to add the official repository signed with the keys of Anthropic and then install the package with the command sudo apt install claude-code.
$ sudo apt install curl gnupg
$ sudo install -d -m 0755 /etc/apt/keyrings
$ sudo curl -fsSL https://downloads.claude.ai/keys/claude-code.asc -o /etc/apt/keyrings/claude-code.asc
$ echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/stable stable main" | sudo tee /etc/apt/sources.list.d/claude-code.list
$ sudo apt update
$ sudo apt install claude-code
According to the setup documentation, apt installs "do not auto-update through Claude Code; updates arrive through your normal system upgrade workflow" โ that is, sudo apt update && sudo apt upgrade claude-code will be the correct way of going to the newer release after that.
How do I verify Claude Code installed correctly?
To check if the installation was performed properly, run claude --version. One will see a version number; however, in case of incorrect installation, the error message command not found will be shown because the PATH variable of the shell does not contain the install location yet.
$ claude --version
2.1.211 (Claude Code)
Besides that, the official documentation mentions the command claude doctor that "prints read-only installation and settings diagnostics without starting a session" โ which can be helpful when --version works well but there are problems with something else in the installation.
How do I update or uninstall Claude Code on Ubuntu?
The native installations of Claude Code update in the background automatically or immediately upon execution of the command claude update. To uninstall Claude Code, one should just delete the binary file and version folder or remove the package with apt if it was installed that way.
$ claude update
$ rm -f ~/.local/bin/claude
$ rm -rf ~/.local/share/claude
The apt installations are uninstalled with the commands sudo apt remove claude-code and removal of the repository file, according to the same documentation โ either way, the ~/.claude settings and session history will stay untouched until one deletes that directory manually.
Our VPS plans and Bare Metal servers both provide a full Ubuntu shell to perform any of the above-described install methods the very moment they are provisioned, so the installation of Claude Code is done the same way as on the local machine.
Get started with Orbit Servers
Low-latency VPS, bare metal, and colocation across the US, EU, and APAC - provisioned instantly and built for performance-critical workloads.
Get startedRelated products
Written by
Julius