Install Claude on Ubuntu 24.04

Posted on Wednesday, March 4, 2026


 


I recently set up a Claude Code Organization https://www.whiteboardcoder.com/2026/03/claude-creating-account-and-setting-up.html [1]

And now I want to get Claude Code installed and running on Ubuntu 24.04

 


Installing

I found this install info at https://code.claude.com/docs/en/setup [2]
From your command line run this command 

 

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

 

 


Success!

Now open a new terminal
And run this as a test
 

 

> claude --version

 

 

 

Let’s pull a simple test repo down from github to test it on.

 

> git clone git@github.com:TheAlgorithms/Python.git
> cd Python

 


Now start Claude 

 

> claude

 

 



If this is your first time you need to do some setup.
Select style I am selecting 1.


Choose login.  I have an API usage org setup so I am choosing 2.

It will attempt to open a web browser.
If it can’t it will post a url.

Open that URL.

 


 

Authorize



Copy this code.


 

Pastes in the code.


Login successful!
press enter



You get this little warning
press enter


 

Trust the code



 

We are up and running.

But…
I suspect that I am using my account vs my workspace.

Press ctrl+c twice in a row to exit.

 


Add API key

Grab your Workspace API key assuming you have it already set up.
And export it as a env in ~/.bashrc

 

> vi ~/.bashrc

 

And add this line (putting in your actual key)

 

export ANTHROPIC_API_KEY="sk-ant-api03-YourFullKeyHere..."

 

 

Source ~/.bashrc to grab it

 

> source ~/.bashrc

 

 

Double check to make sure its in the env variable

 

> env | egrep ANTH

 

 



Now run claude again

 

> claude

 

 



Neat it detected the key.  If it’s the correct key select 1. And press enter.

 

Looks like because I logged in before directly I have a key conflict.  I want to use the API key… So to fix that let me run claude /logout

Ctrl+c twice to get out then run

 

> claude /logout

 

 

Successful logout !

 

 

Start up claude again

 

> claude

 

 


Looks like I have to go through this again
That is not right …
Let me try something
Get out of claude

Something is not right…

Let me test the key itself

 

Running this curl command (Of course put your key in it)

 

> curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: sk-ant-REPLACE_WITH_YOUR_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
      "model": "claude-sonnet-4-6",
      "max_tokens": 1024,
      "messages": [
        {"role": "user", "content": "Hello, Claude!"}
    ]
  }'

 

 

I got something back.
So my key is good.

I did find this issue https://github.com/anthropics/claude-code/issues/441#issuecomment-3050967059 [3]
It looks like this is intended but there may be a work around.

Create the ~/.claide/settings.json file

 

> vi ~/.claude/settings.json

 And place the following in it

 

{

  "apiKeyHelper": "echo $ANTHROPIC_API_KEY"

}


Now let’s try again

 

> claude



Select Dark Mode


 

That worked!
Choose yes!


 

OK still getting this error…
OK I think I have a fix

 Edit ~/.bashrc

 

> vi ~/.bashrc

Rename ANTHROPIC_API_KEY to ANTHROPIC_API_KEY_FIX

 


Edit ~/.claude/setting.json file

 

> vi ~/.claude/settings.json

 

And change the contents to this

 

{

  "apiKeyHelper": "echo $ANTHROPIC_API_KEY_FIX"

}

Appending the _FIX



Kill your terminal and start a new one to bring up the changes.

 

Now let’s try again

 

> claude

That worked!!

😊

 

Now let’s try something

 

> for lower.py is there a simpler way to do this

 


 

And it works 😊

References

 

[1]       Claude creating an account and setting up limits
             
https://www.whiteboardcoder.com/2026/03/claude-creating-account-and-setting-up.html
            Accessed 03/2026
[2]       Administration Advanced Setup
            
https://code.claude.com/docs/en/setup
           Accessed 03/2026
[3]       How can I use my API key without signing inecho
             
https://github.com/anthropics/claude-code/issues/441#issuecomment-3050967059
            Accessed 03/2026

 

 

 

 


 

 

 

 

No comments:

Post a Comment