setup.md +127 −27
20 * Alpine Linux 3.19+20 * Alpine Linux 3.19+
21* **Hardware**: 4 GB+ RAM, x64 or ARM64 processor21* **Hardware**: 4 GB+ RAM, x64 or ARM64 processor
22* **Network**: internet connection required. See [network configuration](/en/network-config#network-access-requirements).22* **Network**: internet connection required. See [network configuration](/en/network-config#network-access-requirements).
2323* **Shell**: Bash, Zsh, PowerShell, or CMD. Native Windows setups require [Git for Windows](https://git-scm.com/downloads/win). WSL setups do not.* **Shell**: Bash, Zsh, PowerShell, or CMD. On native Windows, [Git for Windows](https://git-scm.com/downloads/win) is recommended; Claude Code falls back to PowerShell when Git Bash is absent. WSL setups do not require Git for Windows.
24* **Location**: [Anthropic supported countries](https://www.anthropic.com/supported-countries)24* **Location**: [Anthropic supported countries](https://www.anthropic.com/supported-countries)
25 25
26### Additional dependencies26### Additional dependencies
59 59
60 If you see `The token '&&' is not a valid statement separator`, you're in PowerShell, not CMD. If you see `'irm' is not recognized as an internal or external command`, you're in CMD, not PowerShell. Your prompt shows `PS C:\` when you're in PowerShell and `C:\` without the `PS` when you're in CMD.60 If you see `The token '&&' is not a valid statement separator`, you're in PowerShell, not CMD. If you see `'irm' is not recognized as an internal or external command`, you're in CMD, not PowerShell. Your prompt shows `PS C:\` when you're in PowerShell and `C:\` without the `PS` when you're in CMD.
61 61
6262 **Native Windows setups require [Git for Windows](https://git-scm.com/downloads/win).** Install it first if you don't have it. WSL setups do not need it. [Git for Windows](https://git-scm.com/downloads/win) is recommended on native Windows so Claude Code can use the Bash tool. If Git for Windows is not installed, Claude Code uses PowerShell as the shell tool instead. WSL setups do not need Git for Windows.
63 63
64 <Info>64 <Info>
65 Native installations automatically update in the background to keep you on the latest version.65 Native installations automatically update in the background to keep you on the latest version.
89 </Tab>89 </Tab>
90</Tabs>90</Tabs>
91 91
92You can also install with [apt, dnf, or apk](/en/setup#install-with-linux-package-managers) on Debian, Fedora, RHEL, and Alpine.
93
92After installation completes, open a terminal in the project you want to work in and start Claude Code:94After installation completes, open a terminal in the project you want to work in and start Claude Code:
93 95
94```bash theme={null}96```bash theme={null}
95claude97claude
96```98```
97 99
98100If you encounter any issues during installation, see the [troubleshooting guide](/en/troubleshooting).If you encounter any issues during installation, see [Troubleshoot installation and login](/en/troubleshoot-install).
99 101
100### Set up on Windows102### Set up on Windows
101 103
102You can run Claude Code natively on Windows or inside WSL. Pick based on where your projects are located and which features you need:104You can run Claude Code natively on Windows or inside WSL. Pick based on where your projects are located and which features you need:
103 105
104| Option | Requires | [Sandboxing](/en/sandboxing) | When to use |106| Option | Requires | [Sandboxing](/en/sandboxing) | When to use |
105107| -------------- | ---------------------------------------------------- | ---------------------------- | ----------------------------------------------- || -------------- | ------------------------------------------------------------------------------------------- | ---------------------------- | ----------------------------------------------- |
106108| Native Windows | [Git for Windows](https://git-scm.com/downloads/win) | Not supported | Windows-native projects and tools || Native Windows | [Git for Windows](https://git-scm.com/downloads/win) recommended; PowerShell used if absent | Not supported | Windows-native projects and tools |
107| WSL 2 | WSL 2 enabled | Supported | Linux toolchains or sandboxed command execution |109| WSL 2 | WSL 2 enabled | Supported | Linux toolchains or sandboxed command execution |
108| WSL 1 | WSL 1 enabled | Not supported | If WSL 2 is unavailable |110| WSL 1 | WSL 1 enabled | Not supported | If WSL 2 is unavailable |
109 111
113 115
114Whether you install from PowerShell or CMD only affects which install command you run. Your prompt shows `PS C:\Users\YourName>` in PowerShell and `C:\Users\YourName>` without the `PS` in CMD. If you're new to the terminal, the [terminal guide](/en/terminal-guide#windows) walks through each step.116Whether you install from PowerShell or CMD only affects which install command you run. Your prompt shows `PS C:\Users\YourName>` in PowerShell and `C:\Users\YourName>` without the `PS` in CMD. If you're new to the terminal, the [terminal guide](/en/terminal-guide#windows) walks through each step.
115 117
116118After installation, launch `claude` from PowerShell, CMD, or Git Bash. Claude Code uses Git Bash internally to execute commands regardless of where you launched it. If Claude Code can't find your Git Bash installation, set the path in your [settings.json file](/en/settings):After installation, launch `claude` from PowerShell, CMD, or Git Bash. When Git Bash is installed, Claude Code uses it internally to execute commands regardless of where you launched it. If Claude Code can't find your Git Bash installation, set the path in your [settings.json file](/en/settings):
117 119
118```json theme={null}120```json theme={null}
119{121{
123}125}
124```126```
125 127
126128Claude Code can also run PowerShell natively on Windows as an opt-in preview. See [PowerShell tool](/en/tools-reference#powershell-tool) for setup and limitations.Claude Code can also run PowerShell natively on Windows. When Git Bash is installed, the PowerShell tool is rolling out progressively as an additional option: set `CLAUDE_CODE_USE_POWERSHELL_TOOL=1` to opt in or `0` to opt out. See [PowerShell tool](/en/tools-reference#powershell-tool) for setup and limitations.
127 129
128**Option 2: WSL**130**Option 2: WSL**
129 131
157claude --version159claude --version
158```160```
159 161
162If this fails with `command not found` or another error, see [Troubleshoot installation and login](/en/troubleshoot-install).
163
160For a more detailed check of your installation and configuration, run [`claude doctor`](/en/troubleshooting#get-more-help):164For a more detailed check of your installation and configuration, run [`claude doctor`](/en/troubleshooting#get-more-help):
161 165
162```bash theme={null}166```bash theme={null}
171 175
172## Update Claude Code176## Update Claude Code
173 177
174178Native installations automatically update in the background. You can [configure the release channel](#configure-release-channel) to control whether you receive updates immediately or on a delayed stable schedule, or [disable auto-updates](#disable-auto-updates) entirely. Homebrew and WinGet installations require manual updates.Native installations automatically update in the background. You can [configure the release channel](#configure-release-channel) to control whether you receive updates immediately or on a delayed stable schedule, or [disable auto-updates](#disable-auto-updates) entirely. Homebrew, WinGet, and [Linux package manager](#install-with-linux-package-managers) installations require manual updates.
175 179
176### Auto-updates180### Auto-updates
177 181
178Claude Code checks for updates on startup and periodically while running. Updates download and install in the background, then take effect the next time you start Claude Code.182Claude Code checks for updates on startup and periodically while running. Updates download and install in the background, then take effect the next time you start Claude Code.
179 183
180<Note>184<Note>
181185 Homebrew and WinGet installations do not auto-update. For Homebrew, run `brew upgrade claude-code` or `brew upgrade claude-code@latest`, depending on which cask you installed. For WinGet, run `winget upgrade Anthropic.ClaudeCode`. Homebrew, WinGet, apt, dnf, and apk installations do not auto-update. For Homebrew, run `brew upgrade claude-code` or `brew upgrade claude-code@latest`, depending on which cask you installed. For WinGet, run `winget upgrade Anthropic.ClaudeCode`. For Linux package managers, see the upgrade commands in [Install with Linux package managers](#install-with-linux-package-managers).
182 186
183 **Known issue:** Claude Code may notify you of updates before the new version is available in these package managers. If an upgrade fails, wait and try again later.187 **Known issue:** Claude Code may notify you of updates before the new version is available in these package managers. If an upgrade fails, wait and try again later.
184 188
204 208
205Homebrew installations choose a channel by cask name instead of this setting: `claude-code` tracks stable and `claude-code@latest` tracks latest.209Homebrew installations choose a channel by cask name instead of this setting: `claude-code` tracks stable and `claude-code@latest` tracks latest.
206 210
211### Pin a minimum version
212
213The `minimumVersion` setting establishes a floor. Background auto-updates and `claude update` refuse to install any version below this value, so moving to the `"stable"` channel does not downgrade you if you are already on a newer `"latest"` build.
214
215Switching from `"latest"` to `"stable"` via `/config` prompts you to either stay on the current version or allow the downgrade. Choosing to stay sets `minimumVersion` to that version. Switching back to `"latest"` clears it.
216
217Add it to your [settings.json file](/en/settings) to pin a floor explicitly:
218
219```json theme={null}
220{
221 "autoUpdatesChannel": "stable",
222 "minimumVersion": "2.1.100"
223}
224```
225
226In [managed settings](/en/permissions#managed-settings), this enforces an organization-wide minimum that user and project settings cannot override.
227
207### Disable auto-updates228### Disable auto-updates
208 229
209Set `DISABLE_AUTOUPDATER` to `"1"` in the `env` key of your [`settings.json`](/en/settings#available-settings) file:230Set `DISABLE_AUTOUPDATER` to `"1"` in the `env` key of your [`settings.json`](/en/settings#available-settings) file:
216}237}
217```238```
218 239
240`DISABLE_AUTOUPDATER` only stops the background check; `claude update` and `claude install` still work. To block all update paths, including manual updates, set [`DISABLE_UPDATES`](/en/env-vars) instead. Use this when you distribute Claude Code through your own channels and need users to stay on the version you provide.
241
219### Update manually242### Update manually
220 243
221To apply an update immediately without waiting for the next background check, run:244To apply an update immediately without waiting for the next background check, run:
226 249
227## Advanced installation options250## Advanced installation options
228 251
229252These options are for version pinning, migrating from npm, and verifying binary integrity.These options are for version pinning, Linux package managers, npm, and verifying binary integrity.
230 253
231### Install a specific version254### Install a specific version
232 255
298 </Tab>321 </Tab>
299</Tabs>322</Tabs>
300 323
301324### Deprecated npm installation### Install with Linux package managers
302 325
303326npm installation is deprecated. The native installer is faster, requires no dependencies, and auto-updates in the background. Use the [native installation](#install-claude-code) method when possible.Claude Code publishes signed apt, dnf, and apk repositories. Replace `stable` with `latest` for the rolling channel. Package manager installations do not auto-update through Claude Code; updates arrive through your normal system upgrade workflow.
304 327
305328#### Migrate from npm to nativeAll repositories are signed with the [Claude Code release signing key](#binary-integrity-and-code-signing). Before trusting the key, verify it as described in each tab.
306 329
307330If you previously installed Claude Code with npm, switch to the native installer:<Tabs>
331 <Tab title="apt">
332 For Debian and Ubuntu. To use the rolling channel, change both `stable` occurrences in the `deb` line: the URL path and the suite name.
308 333
309334```bash theme={null} ```bash theme={null}
310335# Install the native binary sudo install -d -m 0755 /etc/apt/keyrings
311336curl -fsSL https://claude.ai/install.sh | bash sudo curl -fsSL https://downloads.claude.ai/keys/claude-code.asc \
337 -o /etc/apt/keyrings/claude-code.asc
338 echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/stable stable main" \
339 | sudo tee /etc/apt/sources.list.d/claude-code.list
340 sudo apt update
341 sudo apt install claude-code
342 ```
312 343
313344# Remove the old npm installation Verify the GPG key fingerprint before trusting it: `gpg --show-keys /etc/apt/keyrings/claude-code.asc` should report `31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE`.
314345npm uninstall -g @anthropic-ai/claude-code
315346``` To upgrade later, run `sudo apt update && sudo apt upgrade claude-code`.
347 </Tab>
348
349 <Tab title="dnf">
350 For Fedora and RHEL:
351
352 ```bash theme={null}
353 sudo tee /etc/yum.repos.d/claude-code.repo <<'EOF'
354 [claude-code]
355 name=Claude Code
356 baseurl=https://downloads.claude.ai/claude-code/rpm/stable
357 enabled=1
358 gpgcheck=1
359 gpgkey=https://downloads.claude.ai/keys/claude-code.asc
360 EOF
361 sudo dnf install claude-code
362 ```
363
364 dnf downloads the key on first install and prompts you to confirm the fingerprint. Verify it matches `31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE` before accepting.
316 365
317366You can also run `claude install` from an existing npm installation to install the native binary alongside it, then remove the npm version. To upgrade later, run `sudo dnf upgrade claude-code`.
367 </Tab>
368
369 <Tab title="apk">
370 For Alpine Linux:
371
372 ```sh theme={null}
373 wget -O /etc/apk/keys/claude-code.rsa.pub \
374 https://downloads.claude.ai/keys/claude-code.rsa.pub
375 echo "https://downloads.claude.ai/claude-code/apk/stable" >> /etc/apk/repositories
376 apk add claude-code
377 ```
318 378
319379#### Install with npm Verify the downloaded key with `sha256sum /etc/apk/keys/claude-code.rsa.pub`, which should report `395759c1f7449ef4cdef305a42e820f3c766d6090d142634ebdb049f113168b6`.
380
381 To upgrade later, run `apk update && apk upgrade claude-code`.
382 </Tab>
383</Tabs>
320 384
321385If you need npm installation for compatibility reasons, you must have [Node.js 18+](https://nodejs.org/en/download) installed. Install the package globally:### Install with npm
386
387You can also install Claude Code as a global npm package. The package requires [Node.js 18 or later](https://nodejs.org/en/download).
322 388
323```bash theme={null}389```bash theme={null}
324npm install -g @anthropic-ai/claude-code390npm install -g @anthropic-ai/claude-code
325```391```
326 392
393The npm package installs the same native binary as the standalone installer. npm pulls the binary in through a per-platform optional dependency such as `@anthropic-ai/claude-code-darwin-arm64`, and a postinstall step links it into place. The installed `claude` binary does not itself invoke Node.
394
395Supported npm install platforms are `darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `linux-x64-musl`, `linux-arm64-musl`, `win32-x64`, and `win32-arm64`. Your package manager must allow optional dependencies. See [troubleshooting](/en/troubleshoot-install#native-binary-not-found-after-npm-install) if the binary is missing after install.
396
327<Warning>397<Warning>
328398 Do NOT use `sudo npm install -g` as this can lead to permission issues and security risks. If you encounter permission errors, see [troubleshooting permission errors](/en/troubleshooting#permission-errors-during-installation). Do NOT use `sudo npm install -g` as this can lead to permission issues and security risks. If you encounter permission errors, see [troubleshooting permission errors](/en/troubleshoot-install#permission-errors-during-installation).
329</Warning>399</Warning>
330 400
331### Binary integrity and code signing401### Binary integrity and code signing
361 Set `VERSION` to the release you want to verify.431 Set `VERSION` to the release you want to verify.
362 432
363 ```bash theme={null}433 ```bash theme={null}
364434 REPO=https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases REPO=https://downloads.claude.ai/claude-code-releases
365 VERSION=2.1.89435 VERSION=2.1.89
366 curl -fsSLO "$REPO/$VERSION/manifest.json"436 curl -fsSLO "$REPO/$VERSION/manifest.json"
367 curl -fsSLO "$REPO/$VERSION/manifest.json.sig"437 curl -fsSLO "$REPO/$VERSION/manifest.json.sig"
415 485
416* **macOS**: signed by "Anthropic PBC" and notarized by Apple. Verify with `codesign --verify --verbose ./claude`.486* **macOS**: signed by "Anthropic PBC" and notarized by Apple. Verify with `codesign --verify --verbose ./claude`.
417* **Windows**: signed by "Anthropic, PBC". Verify with `Get-AuthenticodeSignature .\claude.exe`.487* **Windows**: signed by "Anthropic, PBC". Verify with `Get-AuthenticodeSignature .\claude.exe`.
418488* **Linux**: use the manifest signature above to verify integrity. Linux binaries are not individually code-signed.* **Linux**: binaries are not individually code-signed. If you download directly from the `claude-code-releases` bucket or use the native installer, verify integrity with the manifest signature above. If you install with [apt, dnf, or apk](#install-with-linux-package-managers), your package manager verifies signatures automatically using the repository signing key.
419 489
420## Uninstall Claude Code490## Uninstall Claude Code
421 491
422492To remove Claude Code, follow the instructions for your installation method.To remove Claude Code, follow the instructions for your installation method. If `claude` still runs afterward, you likely have a second installation or a leftover shell alias from an older installer. See [Check for conflicting installations](/en/troubleshoot-install#check-for-conflicting-installations) to find and remove it.
423 493
424### Native installation494### Native installation
425 495
463winget uninstall Anthropic.ClaudeCode533winget uninstall Anthropic.ClaudeCode
464```534```
465 535
536### apt / dnf / apk
537
538Remove the package and the repository configuration:
539
540<Tabs>
541 <Tab title="apt">
542 ```bash theme={null}
543 sudo apt remove claude-code
544 sudo rm /etc/apt/sources.list.d/claude-code.list /etc/apt/keyrings/claude-code.asc
545 ```
546 </Tab>
547
548 <Tab title="dnf">
549 ```bash theme={null}
550 sudo dnf remove claude-code
551 sudo rm /etc/yum.repos.d/claude-code.repo
552 ```
553 </Tab>
554
555 <Tab title="apk">
556 ```sh theme={null}
557 apk del claude-code
558 sed -i '\|downloads.claude.ai/claude-code/apk|d' /etc/apk/repositories
559 rm /etc/apk/keys/claude-code.rsa.pub
560 ```
561 </Tab>
562</Tabs>
563
466### npm564### npm
467 565
468Remove the global npm package:566Remove the global npm package:
477 Removing configuration files will delete all your settings, allowed tools, MCP server configurations, and session history.575 Removing configuration files will delete all your settings, allowed tools, MCP server configurations, and session history.
478</Warning>576</Warning>
479 577
578The VS Code extension, the JetBrains plugin, and the Desktop app also write to `~/.claude/`. If any of them is still installed, the directory is recreated the next time it runs. To remove Claude Code completely, uninstall the [VS Code extension](/en/vs-code#uninstall-the-extension), the JetBrains plugin, and the Desktop app before deleting these files.
579
480To remove Claude Code settings and cached data:580To remove Claude Code settings and cached data:
481 581
482<Tabs>582<Tabs>