|
| 1 | +# Configuring the uv installer |
| 2 | + |
| 3 | +## Changing the install path |
| 4 | + |
| 5 | +By default, uv is installed to `~/.cargo/bin`. To change the installation path, use |
| 6 | +`UV_INSTALL_DIR`: |
| 7 | + |
| 8 | +=== "macOS and Linux" |
| 9 | + |
| 10 | + ```console |
| 11 | + $ curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="/custom/path" sh |
| 12 | + ``` |
| 13 | + |
| 14 | +=== "Windows" |
| 15 | + |
| 16 | + ```powershell |
| 17 | + $env:UV_INSTALL_DIR = "C:\Custom\Path" powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" |
| 18 | + ``` |
| 19 | + |
| 20 | +## Disabling shell modifications |
| 21 | + |
| 22 | +The installer may also update your shell profiles to ensure the uv binary is on your `PATH`. To |
| 23 | +disable this behavior, use `INSTALLER_NO_MODIFY_PATH`. For example: |
| 24 | + |
| 25 | +```console |
| 26 | +$ curl -LsSf https://astral.sh/uv/install.sh | env INSTALLER_NO_MODIFY_PATH=1 sh |
| 27 | +``` |
| 28 | + |
| 29 | +If installed with `INSTALLER_NO_MODIFY_PATH`, subsequent operations, like `uv self update`, will not |
| 30 | +modify your shell profiles. |
| 31 | + |
| 32 | +## Unmanaged installations |
| 33 | + |
| 34 | +In ephemeral environments like CI, use `UV_UNMANAGED_INSTALL` to install uv to a specific path while |
| 35 | +preventing the installer from modifying shell profiles or environment variables: |
| 36 | + |
| 37 | +```console |
| 38 | +$ curl -LsSf https://astral.sh/uv/install.sh | env UV_UNMANAGED_INSTALL="/custom/path" sh |
| 39 | +``` |
| 40 | + |
| 41 | +The use of `UV_UNMANAGED_INSTALL` will also disable self-updates (via `uv self update`). |
| 42 | + |
| 43 | +## Passing options to the install script |
| 44 | + |
| 45 | +Using environment variables is recommended because they are consistent across platforms. However, |
| 46 | +options can be passed directly to the install script. For example, to see the available options: |
| 47 | + |
| 48 | +```console |
| 49 | +$ curl -LsSf https://astral.sh/uv/install.sh | sh -s -- --help |
| 50 | +``` |
0 commit comments