Sunday, June 7, 2026

Install Claude Code on ubuntu VPS of Bluehost

Trying to install claude code on bluehost vps with "curl -fsSL https://claude.ai/install.sh | bash" freezed the machine. the curl -fsSL https://claude.ai/install.sh | bash script hanging or freezing the machine during the final stages of a Linux installation is a documented issue.

The script frequently hangs at the Finalizing installation... step. This is because the downloaded Claude binary executes an internal loop to automatically scan, detect, and rewrite shell files (like .bashrc or .zshrc) to insert itself into your system PATH. In restricted virtual private server (VPS) environments like Bluehost—where terminal TTY inputs, file locks, or strict security permissions block background configuration rewrites—this loop gets permanently stuck and consumes available server resources.


You can easily bypass the broken native script by using the traditional, highly reliable Node Package Manager (npm) installation path.

 

How to Install Claude Code Safely via npm

Because Bluehost VPS servers typically run standard Linux environments, installing via npm avoids the buggy shell-rewriting binary wrapper entirely. [1]

1. Install Node.js and npm (if not already present on your VPS): 

 sudo apt update && sudo apt install -y nodejs npm

2. Configure npm to install globally without root permissions (highly recommended to avoid EACCES security lockouts):

mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
 

3. Manually add the new path to your profile file (manually doing what the frozen script failed to do):

echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
  

4. Install Claude Code via npm:

npm install -g @anthropic-ai/claude-code
 

5. Turn off the buggy auto-updater (the native background auto-updater can trigger the same system freeze later on):

echo 'export DISABLE_AUTOUPDATER=1' >> ~/.bashrc
source ~/.bashrc
 

6. Launch and authenticate:

claude
 

No comments:

Blog Archive

Followers