General Configuration
UV_CACHE_DIR
Specify the cache directory location.Path to the cache directory. Overrides the default platform-specific cache location.
- Unix:
$XDG_CACHE_HOME/uvor$HOME/.cache/uv - Windows:
%LOCALAPPDATA%\uv\cache
UV_CONFIG_FILE
Use a specific configuration file instead of discovering one.Path to a
uv.toml file. When set, uv ignores all discovered configuration files.UV_NO_CONFIG
Disable all persistent configuration file discovery.Set to
1 or true to disable configuration file discovery.Index Configuration
UV_INDEX
Add an additional package index (equivalent to--index).
Index URL, optionally with a name prefix:
name=url or just url.UV_DEFAULT_INDEX
Set the default package index, replacing PyPI.Default index URL, optionally with a name prefix:
name=url or just url.UV_INDEX_STRATEGY
Control how uv searches across multiple indexes.Index search strategy:
first-index: Use first index containing the package (prevents dependency confusion)unsafe-first-match: Prefer first index with compatible versionunsafe-best-match: Select best version across all indexes
UV_INDEX_*_USERNAME
Provide username for a named index.Username for authentication.
<NAME> is the uppercase index name with non-alphanumeric characters replaced by underscores.UV_INDEX_*_PASSWORD
Provide password or token for a named index.Password or token for authentication.
<NAME> follows the same normalization as USERNAME.| Index Name | Username Variable | Password Variable |
|---|---|---|
internal-proxy | UV_INDEX_INTERNAL_PROXY_USERNAME | UV_INDEX_INTERNAL_PROXY_PASSWORD |
azure.artifacts | UV_INDEX_AZURE_ARTIFACTS_USERNAME | UV_INDEX_AZURE_ARTIFACTS_PASSWORD |
my_registry | UV_INDEX_MY_REGISTRY_USERNAME | UV_INDEX_MY_REGISTRY_PASSWORD |
Authentication
UV_KEYRING_PROVIDER
Enable keyring provider for credential retrieval.Keyring provider:
disabled: No keyringsubprocess: InvokekeyringCLI
NETRC
Specify a custom netrc file location.Path to netrc file containing credentials. Defaults to
~/.netrc if not set.UV_NO_HF_TOKEN
Disable automatic Hugging Face authentication.Set to
1 to disable Hugging Face token usage.Project Configuration
UV_PROJECT_ENVIRONMENT
Customize the project virtual environment path.Path to the project virtual environment. Relative paths are resolved from the workspace root.
UV_PYTHON_INSTALL_DIR
Override the Python installation directory.Directory where managed Python versions are installed.
~/.local/share/uv/python (Unix) or %LOCALAPPDATA%\uv\python (Windows)
UV_PYTHON_BIN_DIR
Override the Python executable directory.Directory where Python executables are installed.
Tool Configuration
UV_TOOL_DIR
Customize the tools installation directory.Directory where tools are installed.
~/.local/share/uv/tools (Unix) or %LOCALAPPDATA%\uv\tools (Windows)
UV_TOOL_BIN_DIR
Customize the tool executable directory.Directory where tool executables are installed.
Environment Files
UV_ENV_FILE
Load environment variables from dotenv files.Path(s) to dotenv files. Multiple paths separated by spaces.
UV_NO_ENV_FILE
Disable dotenv file loading.Set to
1 to disable loading environment files.Installation & Upgrades
UV_INSTALL_DIR
Customize where the uv executable is installed.Directory where
uv and uvx executables are installed when using the standalone installer.UV_NO_MODIFY_PATH
Prevent the installer from modifying PATH.Set to
1 to prevent PATH modifications during installation.Publishing
UV_PUBLISH_URL
Set the publish URL without modifying project configuration.URL for publishing packages.
UV_PUBLISH_USERNAME
Provide username for publishing.Username for package publishing authentication.
UV_PUBLISH_PASSWORD
Provide password or token for publishing.Password or token for package publishing authentication.
Preview Features
UV_PREVIEW
Enable all preview features.Set to
1 to enable all preview features.UV_PREVIEW_FEATURES
Enable specific preview features.Comma-separated list of preview features to enable.
native-auth: Use system-native credential storage (Keychain/Credential Manager/Secret Service)
Git Configuration
UV_GIT_LFS
Control Git LFS behavior for dependencies.Configure Git LFS for all Git sources without explicit LFS setting:
auto: Use LFS if available (default)enabled: Require LFSdisabled: Never use LFS
Cache Management
UV_LOCK_TIMEOUT
Set timeout for cache lock operations.Timeout in seconds for acquiring cache locks. Used by
uv cache clean and similar operations.TLS Configuration
UV_NATIVE_TLS
Use native TLS implementation instead of rustls.Set to
true to use system-native TLS.Examples
CI/CD Environment
Docker Build
Local Development with Multiple Indexes
Airgapped/Offline Environment
Azure DevOps Pipeline
GitHub Actions
Precedence Order
Configuration sources in order of precedence (highest to lowest):- Command-line arguments (e.g.,
--cache-dir /tmp/cache) - Environment variables (e.g.,
UV_CACHE_DIR=/tmp/cache) - Project configuration (e.g.,
pyproject.tomloruv.toml) - User configuration (e.g.,
~/.config/uv/uv.toml) - System configuration (e.g.,
/etc/uv/uv.toml) - Defaults
Related Resources
- Configuration Files - Persistent configuration with pyproject.toml and uv.toml
- Authentication - Configure credentials for private indexes
- Indexes - Custom package index configuration
- Settings Reference - Complete settings documentation