Cyberithub

How to Install Claude Code on Linux

Advertisements

In this article, we will see how to install Claude code on Linux. Claude code is a terminal based agentic assistant designed to assist developers and professionals with their application development, testing and analysing code, performing bug fixes, automate tasks and so on. It basically works by reading your code, understanding and analyzing the functionalities implemented and then assisting you with ideas, fixes and features implemented. Claude can read entire codebases in seconds and maps all dependencies without having to manually select context files. It can be easily integrated with all git based version control systems and can be used write code, run test, fix issues and can even be used to create PRs.

Claude code can be very handy in fixing broken functionalities as it can search and fix the problem from millions lines of code in few seconds which otherwise requires significant time and effort. It is available in Pro, Max and Teams plan thus allowing you to conveniently choose any of the plans as per your need. You can run Claude code session in almost any of the environments with ease. It can also be integrated with powerful IDEs such as VS code and JetBrains IDE.  More on official website. Here we will see how to install Claude code on linux based systems and use it for our purposes. For demo purpose, I am using Ubuntu based linux system here.

 

How to Install Claude Code on Linux

How to Install Claude Code on Linux

Also Read: How to republish existing data using Apache Kafka Connect

Step 1: Prerequisites

a) You should have a running Linux System.

b) You should have sudo access to install application in your System.

c) You should have curl utility installed in your System.

d) You should have a valid Claude subscription.

e) You should have internet connected to your System.

 

Step 2: Update Your System

Before installing Claude code, make sure to update your packages to have all dependencies available in your System. You may be using any linux based system, use appropriate command to install latest updates. Since here I am using Ubuntu based system, I am using sudo apt update && sudo apt upgrade to install all updates in my system.

cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade

 

Step 3: Install Claude Code

Once the system is updated, you can run below installation script to install Claude code on your System. It has taken from official download page. Wait for few minutes to complete the installation. After successful installation, you should see below successfully installed message. In case of any error, it will throw the error message on the output.

cyberithub@ubuntu:~$ curl -fsSL https://claude.ai/install.sh | bash
Setting up Claude Code...

✔ Claude Code successfully installed!

Version: 2.1.273

Location: ~/.local/bin/claude


Next: Run claude --help to get started

✅ Installation complete!

 

Step 4: Check Version

To verify installation, you can run claude --version command. It will display the installed version on output as shown below.

cyberithub@ubuntu:~$ claude --version
2.1.273 (Claude Code)

 

Step 5: Login to Claude Account

To login and authenticate, run claude on your terminal as shown below.

cyberithub@ubuntu:~$ claude
Welcome to Claude Code v2.1.273
..........................................................

  *                               █████▓▓░
  *                             ███▓░     ░░
            ░░░░░░             ███▓░
      ░░░ ░░░░░░░░░░           ███▓░
     ░░░░░░░░░░░░░░░░░░░ *      ██▓░░    ▓
                                  ░▓▓███▓▓░
* ░░░░
░░░░░░░░
░░░░░░░░░░░░░░░░
█████████ *
██▄█████▄██ *
█████████ *
.......█ █ █ █..........................................

Let's get started.

Choose the text style that looks best with your terminal
To change this later, run /theme

1. Auto (match terminal)
❯ 2. Dark mode ✔
3. Light mode
4. Dark mode (colorblind-friendly)
5. Light mode (colorblind-friendly)
6. Dark mode (ANSI colors only)
7. Light mode (ANSI colors only)

╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
1 function greet() {
2 - console.log("Hello, World!");
2 + console.log("Hello, Claude!");
3 }
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
Syntax theme: Monokai Extended (ctrl+t to disable)

If you do not have ANTHROPIC_API_KEY environment variable set, then it would ask you to select login method to authenticate as shown below.

Claude Code can be used with your Claude subscription or billed based on API usage through your Console account.

Select login method:

❯ 1. Claude account with subscription · Pro, Max, Team, or Enterprise
  2. Anthropic Console account · API usage billing
  3. 3rd-party platform · Amazon Bedrock, Microsoft Foundry, or Vertex AI

If you have already set then Claude will instead ask you to approve the key. If you would like to re-authenticate or switch account then you can manually run /login inside the session.

/login

 

Step 6: Switch to your project

Once authentication completes, you can open a command terminal and switch to your project by changing to project working location path. Then launch claude code to start using claude in your project.

cyberithub@ubuntu:~$ cd /home/cyberithub/TestProject/
cyberithub@ubuntu:~/TestProject$ claude

 

Step 7: Using Claude code in your project

It is now time to use Claude code to read and analyze your project. To perform that, you can query about your project which will allow Claude to look into your project files.

What is my project about ?

Then you can continue asking more and more information about your project once it analyzes all the project files. For example you can ask how many files are there in my project?

How many files are there in my project ?

You can also ask Claude how can it assist you with your project.

How Claude can assist me in my project ?

 

Step 8: Edit your project using Claude code

You can also choose to edit your files using claude code. For example, if you would like to change some keyword or line of code in all the files of your project then you can simply ask.

Please replace addTest function with addCyber in all the files in my project

It will show you all the changes needed to be done in all the files and prompt you for confirmation. Once you confirm, it will execute all the changes.

 

Step 9: Perform Git Operations

You can also choose to perform git operations in your project by using simple conversation with Claude code. For example if you want to create a branch called feature/addCyber, use below prompt.

Create a new branch called feature/addCyber

Similarly, if you want to check last git log then use below prompt.

Show me last git log

You can also choose to delete a branch using below prompt. It will ask you for confirmation. Once confirmed, it will perform the deletion. Similarly, you can run other git based operations.

Delete branch feature/addCyber

Leave a Comment