Installing Ruff | Ruff (original) (raw)

Ruff is available as ruff on PyPI.

Ruff can be invoked directly with uvx:

[](#%5F%5Fcodelineno-0-1)uvx ruff check # Lint all files in the current directory. [](#%5F%5Fcodelineno-0-2)uvx ruff format # Format all files in the current directory.

Or installed with uv (recommended), pip, or pipx:

[](#%5F%5Fcodelineno-1-1)$ # Install Ruff globally. [](#%5F%5Fcodelineno-1-2)$ uv tool install ruff@latest [](#%5F%5Fcodelineno-1-3) [](#%5F%5Fcodelineno-1-4)$ # Or add Ruff to your project. [](#%5F%5Fcodelineno-1-5)$ uv add --dev ruff [](#%5F%5Fcodelineno-1-6) [](#%5F%5Fcodelineno-1-7)$ # With pip. [](#%5F%5Fcodelineno-1-8)$ pip install ruff [](#%5F%5Fcodelineno-1-9) [](#%5F%5Fcodelineno-1-10)$ # With pipx. [](#%5F%5Fcodelineno-1-11)$ pipx install ruff

Once installed, you can run Ruff from the command line:

[](#%5F%5Fcodelineno-2-1)$ ruff check # Lint all files in the current directory. [](#%5F%5Fcodelineno-2-2)$ ruff format # Format all files in the current directory.

Starting with version 0.5.0, Ruff can also be installed with our standalone installers:

[](#%5F%5Fcodelineno-3-1)$ # On macOS and Linux. [](#%5F%5Fcodelineno-3-2)$ curl -LsSf https://astral.sh/ruff/install.sh | sh [](#%5F%5Fcodelineno-3-3) [](#%5F%5Fcodelineno-3-4)$ # On Windows. [](#%5F%5Fcodelineno-3-5)$ powershell -c "irm https://astral.sh/ruff/install.ps1 | iex" [](#%5F%5Fcodelineno-3-6) [](#%5F%5Fcodelineno-3-7)$ # For a specific version. [](#%5F%5Fcodelineno-3-8)$ curl -LsSf https://astral.sh/ruff/0.5.0/install.sh | sh [](#%5F%5Fcodelineno-3-9)$ powershell -c "irm https://astral.sh/ruff/0.5.0/install.ps1 | iex"

For macOS Homebrew and Linuxbrew users, Ruff is also available as ruff on Homebrew:

For Conda users, Ruff is also available as ruff onconda-forge:

[](#%5F%5Fcodelineno-5-1)$ conda install -c conda-forge ruff

For pkgx users, Ruff is also available as ruffon the pkgx registry:

For Arch Linux users, Ruff is also available as ruffon the official repositories:

For Alpine users, Ruff is also available as ruffon the testing repositories:

For openSUSE Tumbleweed users, Ruff is also available in the distribution repository:

[](#%5F%5Fcodelineno-9-1)$ sudo zypper install python3-ruff

On Docker, it is published as ghcr.io/astral-sh/ruff, tagged for each release and latest for the latest release.

[](#%5F%5Fcodelineno-10-1)$ docker run -v .:/io --rm ghcr.io/astral-sh/ruff check [](#%5F%5Fcodelineno-10-2)$ docker run -v .:/io --rm ghcr.io/astral-sh/ruff:0.3.0 check [](#%5F%5Fcodelineno-10-3) [](#%5F%5Fcodelineno-10-4)$ # Or, for Podman on SELinux. [](#%5F%5Fcodelineno-10-5)$ docker run -v .:/io:Z --rm ghcr.io/astral-sh/ruff check

Packaging status