Linux
Install Claude Code on Linux
Five steps using Anthropic’s current native Linux installer and a verified StartupAPI connection.
Install Claude Code
Open a Bash terminal and run:
Downloads and runs Anthropic's official native installer for Linux.
curl -fsSL https://claude.ai/install.sh | bashConfirm it installed
Run:
Prints the installed version and confirms the command is on your PATH.
claude --versionA version such as 2.1.211 (Claude Code)Connect StartupAPI
Replace one managed block in your Bash profile.
This replaces one clearly marked StartupAPI block in your profile. It is safe to rerun when you rotate a key or choose new model identifiers. Replace YOUR_STARTUPAPI_API_KEY with your key.
PROFILE="$HOME/.bashrc"
START="# >>> StartupAPI Claude Code >>>"
END="# <<< StartupAPI Claude Code <<<"
touch "$PROFILE"
TMP="$(mktemp)"
awk -v start="$START" -v end="$END" '$0 == start { skip=1; next } $0 == end { skip=0; next } !skip { print }' "$PROFILE" > "$TMP"
cat >> "$TMP" <<'STARTUPAPI_EOF'
# >>> StartupAPI Claude Code >>>
export ANTHROPIC_BASE_URL="https://startupapi.io"
export ANTHROPIC_AUTH_TOKEN="YOUR_STARTUPAPI_API_KEY"
unset ANTHROPIC_API_KEY
export ANTHROPIC_MODEL="claude-sonnet-4-6"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-6"
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-6"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5"
export CLAUDE_CODE_SUBAGENT_MODEL="claude-sonnet-4-6"
# <<< StartupAPI Claude Code <<<
STARTUPAPI_EOF
mv "$TMP" "$PROFILE"
. "$PROFILE"Open your project
Change to the repository you want Claude Code to use:
Makes your project the working directory for the session.
cd "/path/to/your-project"Launch and verify the gateway
Start Claude Code, then inspect the active connection.
Launches an interactive Claude Code session. At the prompt, enter /status.
claudeCommon mistakes
- Missing Alpine packagesInstall bash, curl, libgcc, libstdc++, and ripgrep first, then set USE_BUILTIN_RIPGREP=0 in Claude Code settings.
- Using the wrong profileBash reads ~/.bashrc; zsh normally reads ~/.zshrc.
- Checking with a model replyA reply proves only that some endpoint answered. Use /status to verify the StartupAPI base URL.
Troubleshooting
Hit an install, PATH, authentication, or model error? Match it to the Troubleshooting guide.
Open Troubleshooting