Install Claude Code on an Ubuntu VM
Native installation method using curl only
| Scope: This document covers only the official native Claude Code installer using curl. It does not include npm, apt, Homebrew, WinGet, or the Claude Desktop app. |
1. Requirements
- Ubuntu VM with internet access.
- A Bash-compatible terminal session.
- curl and CA certificates installed.
- A Claude account ready for login after installation.
sudo apt update
sudo apt install -y curl ca-certificates
| Subscription requirement: For an individual Claude.ai login, use a Claude Pro or Claude Max subscription. Free accounts are not enough for this Claude Code subscription login path. Team and Enterprise may appear on the login screen for organization accounts, but this guide is focused on the individual Pro/Max path. |
2. Install Claude Code using curl
- Open a terminal on the Ubuntu VM.
- Run the native installer command:
curl -fsSL https://claude.ai/install.sh | bash
- Wait until the installer confirms that Claude Code was successfully installed.
Screenshot 1 - Claude Code successfully installed. The binary location is shown as ~/.local/bin/claude.
- Reload the shell so the claude command is available in the current terminal session:
source ~/.bashrc
Alternative: Closing and reopening the terminal also reloads the shell environment.
3. Verify the installation
Run the following commands:
which claude
claude --version
Expected result:
/home/<your-user>/.local/bin/claude
<installed-version>
4. Start Claude Code for the first time
Go to the project folder you want Claude Code to work with, then launch Claude:
cd /path/to/your/project
claude
- When prompted, choose the terminal text style that looks best. In the example below, Dark mode is selected.
Screenshot 2 - First launch screen where you choose the terminal text style.
- On the login method screen, choose Claude account with subscription.
- For individual users, make sure the Claude account has either a Pro or Max subscription.
Screenshot 3 - Login method screen. For this guide, select Claude account with subscription and use an individual Pro or Max subscription.
| Important: Do not choose Anthropic Console account unless the customer intentionally wants API usage billing through the Console. Do not choose a third-party platform unless the organization uses Amazon Bedrock, Microsoft Foundry, or Vertex AI. |
- After login is completed, Claude Code opens the interactive prompt. The account/subscription information appears in the welcome panel, and Claude Code is ready to receive questions or tasks in the terminal.
Screenshot 4 - Claude Code after successful login. The welcome panel confirms the account context and the terminal prompt is ready for questions or tasks.
5. Login note for SSH or headless VMs
If the VM cannot open a browser automatically, Claude Code may show a login URL or login code in the terminal. Copy the URL or code from the VM terminal, open it in your local browser, complete the login, and paste the code back into the terminal if requested.
6. Uninstall Claude Code installed with curl
For the native curl installer, remove the Claude Code binary and local shared files:
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
hash -r
Verify removal:
which claude
claude --version
Expected result after removal:
claude: command not found
7. Optional full cleanup
Use this only if you also want to remove saved Claude Code settings, local state, cached data, and previous login/session data:
rm -rf ~/.claude
rm -f ~/.claude.json
8. Troubleshooting
| Issue | Fix |
| claude: command not found after install | Run source ~/.bashrc, close and reopen the terminal, or confirm ~/.local/bin is in PATH. |
| curl: command not found | Run sudo apt update && sudo apt install -y curl ca-certificates. |
| Login cannot open browser on VM | Copy the authentication URL or code from the VM terminal and complete the login in your local browser. |
| Wrong login method selected | Exit and run claude again. Choose Claude account with subscription for the Pro/Max individual subscription flow. |
| Claude still runs after uninstall | Check for another install path using which -a claude and remove the extra entry if needed. |
9. References
Official Anthropic documentation used for the installation and authentication notes:
- Claude Code Quickstart: https://docs.anthropic.com/en/docs/claude-code/quickstart
- Claude Code Authentication: https://docs.anthropic.com/en/docs/claude-code/iam
Comments
0 comments
Please sign in to leave a comment.