Install Claude
Install Node
bash
# 1. Add the NodeSource repository (Node.js v22.x)
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
# 2. Install Node.js
sudo apt install -y nodejs
# 3. Verify the installation
node --version
npm --versionInstall Claude Code
bash
# 4. Install Claude Code globally via npm
sudo npm install -g @anthropic-ai/claude-code
# 5. Verify the installation
claude --versionSet environment variables
Method 1: Set global environment variables
bash
# 1. Open the ~/.bashrc file
nano ~/.bashrc
# 2. Add the following content
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=sk-YourDeepSeekKey
export ANTHROPIC_MODEL=deepseek-v4-pro[1m]
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-v4-pro[1m]
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-v4-pro[1m]
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-v4-flash[1m]
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-v4-flash
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=1000000Method 2: Set Claude environment variables
Step 1: Create the config directory and file
bash
mkdir -p ~/.claude
nano ~/.claude/settings.jsonStep 2: Paste the following content
Replace sk-YourDeepSeekKey with the API key you applied for on the DeepSeek website:
json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
"ANTHROPIC_AUTH_TOKEN": "sk-YourDeepSeekKey",
"ANTHROPIC_MODEL": "deepseek-v4-pro[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-v4-pro[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-v4-pro[1m]",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4-flash[1m]",
"CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-v4-flash",
"CLAUDE_CODE_MAX_CONTEXT_TOKENS": "1000000"
}
}