Skip to main content
Pixi supports authentication with various package repositories including prefix.dev, private Quetz instances, anaconda.org, and PyPI registries.

Authentication Methods

Pixi supports multiple authentication methods:
  • Bearer Token - Used by prefix.dev
  • Conda Token - Used by anaconda.org and Quetz
  • Basic HTTP Auth - Username and password
  • S3 Credentials - For S3-based channels
  • Keyring - For PyPI registries

Conda Channel Authentication

Command Syntax

Authentication Examples

S3 authentication also supports AWS’s standard AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables. See the S3 section for details.

Authentication Types Explained

Bearer Token

Standard token authentication used by prefix.dev. The token is sent with every request in the Authorization header:

Conda Token

Used by anaconda.org and Quetz servers. The token is encoded in the URL:

Basic HTTP Authentication

Username and password authentication, commonly used with self-hosted servers:
Easily configured with reverse proxies like Nginx or Apache.

Credential Storage

Platform-Specific Storage

Pixi stores credentials securely using your system’s keychain:

Fallback Storage

On servers without keychain support, Pixi stores credentials in an insecure JSON file:
This fallback storage is unencrypted. Use environment-based authentication in production environments.

Override Authentication Storage

Use the RATTLER_AUTH_FILE environment variable to specify a custom credentials file:
RATTLER_AUTH_FILE takes precedence over the CLI --auth-file argument.

Credentials File Format

The JSON file should follow this format:
credentials.json
Wildcard hosts (e.g., *.prefix.dev) match any subdomain like repo.prefix.dev. You can also configure the authentication file in the global configuration file.

PyPI Authentication

Pixi supports two methods for PyPI authentication:
  1. Keyring authentication
  2. .netrc file authentication

Keyring Authentication

Pixi uses the Python keyring library for PyPI authentication.
1

Install Keyring

Install keyring globally based on your registry type:
2

Configure Credentials

Store credentials and configure your workspace:
3

Install with Keyring

Enable keyring provider when installing:
Or configure globally in your Global Config:

.netrc File Authentication

Store PyPI credentials in a .netrc file:
1

Create .netrc file

Create the file in your home directory:
2

Add credentials

.netrc
3

Use custom location (optional)

Set the NETRC environment variable:
For more details, see the .netrc file format documentation.

Best Practices

Use Secrets Management

Never commit credentials to version control. Use environment variables or CI/CD secrets.

Rotate Credentials

Regularly rotate authentication tokens and passwords for better security.

Minimal Permissions

Use tokens with minimal required permissions for each use case.

Environment-Specific Auth

Use different credentials for development, staging, and production environments.