
Cargo
Cargo is the free Rust package manager and build tool, used through a command-line interface.
What Cargo is
Cargo is the free Rust package manager and build tool, used through a command-line interface. It downloads dependencies, builds packages, and helps keep builds repeatable with lockfile support. Developers can compile, check, document, test, run, package, install, and publish Rust projects with Cargo. The `cargo new` command creates a package, defaulting to a binary program; adding `--lib` creates a library. Cargo uses crates.io as its default registry and also supports alternate registries, Git dependencies, and local filesystem paths. Workspaces let multiple packages share a lockfile and output directory. Package features can enable conditional compilation and optional dependencies. In offline mode, Cargo avoids network access and tries to use locally cached data. It supports new subcommands without changes to Cargo itself, as well as registry authentication options. Rustup installs Cargo alongside the stable Rust release, with installation instructions for Windows, macOS, Linux, and other Unix-like systems. Some features are unstable and require a nightly toolchain and `-Z` flags. Cargo is open source under the MIT and Apache License, Version 2.0.
Good
- Manages dependencies from registries, Git, and local paths
- Lockfiles support repeatable builds
- Workspaces share a lockfile and output directory
- Can operate offline with cached data
Watch out
- Some features require a nightly toolchain and `-Z` flags
- Offline operation depends on locally cached data
Who it suits
Cargo suits developers building and managing Rust packages. It is especially relevant to projects that need dependency management, workspaces, or repeatable builds.
Verdict
Cargo brings dependency management, builds, testing, and publishing into the Rust command-line workflow. Its support for workspaces and offline operation is useful, though some documented features remain unstable.
Plans and prices
From Cargo's own pricing page, checked 30 Sep 2026.
| Plan | Price | What it gives you |
|---|---|---|
| Cargo | Free | Free Rust package manager and build tool |
The facts
Each one read from Cargo's own pages, with the date it was checked.
What it does
- Alternate registries
- Cargo supports alternate registries configured through .cargo/config.toml and supports git and sparse registry protocols.checked 28 Sep 2026
- Build tool
- Cargo invokes rustc or another build tool with the correct parameters to build packages.checked 28 Sep 2026
- CI integrations
- The Cargo guide gives build and test examples for GitHub Actions, GitLab CI, builds.sr.ht, and CircleCI.checked 30 Sep 2026
- Command line
- Cargo is used through a command line interface.checked 30 Sep 2026
- Commands
- Cargo includes commands for compiling, checking, documenting, testing, running, packaging, installing, and publishing Rust packages.checked 28 Sep 2026
- Conditional compilation
- Cargo features express conditional compilation and optional dependencies and are enabled with command-line flags such as --features.checked 28 Sep 2026
- Conditional features
- Package features allow conditional compilation and optional dependencies, and can be enabled from the command line.checked 30 Sep 2026
- Default registry
- Cargo installs crates and fetches dependencies from a registry, with crates.io as the default registry.checked 28 Sep 2026
- Dependencies
- Cargo supports dependencies from crates.io, other registries, Git repositories, and local filesystem paths.checked 30 Sep 2026
- Dependency management
- Cargo downloads and builds package dependencies and helps ensure repeatable builds.checked 28 Sep 2026
- Dependency resolution
- Yeschecked 22 Sep 2026
- Extensibility
- Cargo supports new subcommands without modifying Cargo itself.checked 28 Sep 2026
- Installation
- The documented rustup installer installs Cargo alongside the stable Rust release.checked 30 Sep 2026
- Intended users
- The Cargo Book presents Cargo as a tool for developing Rust packages.checked 30 Sep 2026
- Lockfile support
- Yeschecked 22 Sep 2026
- Nightly constraints
- Cargo documents some features as unstable and requiring a nightly toolchain and -Z flags.checked 30 Sep 2026
- Offline installation
- Yeschecked 22 Sep 2026
- Offline operation
- With net.offline set to true or the --offline option, Cargo avoids accessing the network and attempts to proceed with locally cached data.checked 28 Sep 2026
- Package creation
- The cargo new command creates a package and defaults to creating a binary program; --lib creates a library.checked 28 Sep 2026
- Package formats
- Rust crates; crates.io packages; alternate registry packages; Git dependencies; local path dependencieschecked 22 Sep 2026
- Package yanking
- Cargo can mark a published crate version yanked so new dependency resolution avoids it while existing lockfiles continue to work.checked 30 Sep 2026
- Private registry auth
- Yeschecked 22 Sep 2026
- Purpose
- Cargo is the Rust package manager.checked 28 Sep 2026
Money
- Free plan
- Yeschecked 22 Sep 2026
The full review of Cargo
Cargo is the package manager and build tool for Rust software. It is the natural fit for developers building Rust packages who want dependencies, builds, tests, and releases in one command-line workflow. It is free and broad in scope, though features marked unstable require a nightly toolchain.
Overview
Cargo handles much of a Rust package’s lifecycle: it fetches dependencies, invokes rustc or another build tool with the needed parameters, and provides commands to compile, check, document, test, run, package, install, and publish. The cargo new command starts a binary package by default; use --lib to start a library. That breadth makes Cargo a practical everyday tool for Rust development, not merely a dependency downloader.
Dependencies can come from crates.io, alternate registries, Git repositories, or local paths. Lockfiles help keep builds repeatable, and workspaces let related packages share a lockfile and output directory. The clear limitation is language scope: Cargo is designed for Rust packages, not projects in other ecosystems.
Key features
Dependencies and registries
Crates.io is the default registry, while alternate registries can be configured in .cargo/config.toml with Git or sparse protocols. Cargo supports private-registry authentication, useful for teams consuming internal packages. Credential providers can store tokens in Windows Credential Manager, macOS Keychain, or libsecret; the cargo:token provider instead stores tokens as unencrypted text, so the choice of provider matters for credential security.
Workspaces and offline builds
Workspaces manage multiple packages together, sharing a Cargo.lock file and output directory. This helps keep related crates coordinated without treating each package as an isolated project. With net.offline enabled or the --offline option, Cargo avoids network access and attempts to work from cached data. That is useful for disconnected or restricted environments, but it depends on the required data already being cached.
Features, publishing, and extensibility
Package features enable conditional compilation and optional dependencies, selectable with flags such as --features. Cargo can create distributable packages and upload them to crates.io. It can also mark a published version as yanked so new dependency resolution avoids it while existing lockfiles continue to work. New subcommands extend Cargo without changing Cargo itself. Some documented features remain unstable and require a nightly toolchain with -Z flags, which makes them a poor foundation for workflows that need stable-toolchain compatibility.
Pricing
Cargo is free: its plan costs free. The free plan is the complete Rust package manager and build tool, with no trial period or paid tier to weigh against it. That makes it an accessible choice for individual developers and teams alike; the meaningful trade-offs are technical, not subscription limits.
Platforms
Cargo is included with the Rust toolchain installed through rustup, with installation instructions for Windows, macOS, Linux, and other Unix-like systems. It is used through a command-line interface, so it suits developers comfortable working in a terminal rather than those looking for a graphical package-management app.
Who it's for
Cargo is for developers building Rust packages, from standalone binaries and libraries to multi-package workspaces. It is particularly useful when a project needs dependency resolution across registries, Git, or local paths, repeatable builds, and integrated test and publishing commands. It is not the right choice as a general package manager for a mixed-language project.
Pros and cons
- Pros: Covers dependency management, builds, checks, tests, packaging, and publishing in one Rust-focused tool, reducing the need to piece together separate package-lifecycle commands.
- Pros: Workspaces, lockfiles, private registry authentication, and offline mode support coordinated and repeatable development across different environments.
- Pros: Free and included with the Rust toolchain, with support across Windows, macOS, Linux, and other Unix-like systems.
- Cons: Its Rust focus makes it unsuitable as a cross-language package manager.
- Cons: Offline operation depends on cached data, and the cargo:token credential provider stores tokens unencrypted.
- Cons: Unstable features require nightly Rust and -Z flags, limiting their suitability for stable-toolchain workflows.
Alternatives
For JavaScript package management, consider npm, which offers a free plan for public package authors with unlimited public packages, public publishing, and registry access. Python developers can choose uv instead, a free open-source Python package manager. Yarn is another free open-source package manager with no paid plans or usage limits stated. For build workflows, Gradle is a free open-source build system; pip is a free option for Python package management. pnpm is another free package manager. Java projects can use Apache Maven, a free option that requires JDK 8+ for Maven 3.10. PHP developers can consider Composer, a free dependency manager under the MIT license. Browse the Package Managers category for more choices.
Verdict
Choose Cargo if you build Rust software and want a free tool that carries packages from dependency resolution through testing and publishing, with workspaces and offline operation in the same workflow. Look elsewhere if you need a manager for other languages, or if your workflow depends on unstable features but must remain on stable Rust.
Getting started
- Open the Cargo documentation website
- Install Rust through the documented rustup installer
- Choose the installer for Windows, macOS, Linux, or another Unix-like system
- Use Cargo from the command line after it is installed with the Rust toolchain
- Create a package with cargo new, or create a library with cargo new --lib
Questions
How much does Cargo cost?
Cargo is free, with a listed price of no cost plan.
Which systems support Cargo?
Cargo is included with Rust installations for Windows, macOS, Linux, and other Unix-like systems.
Where does Cargo get packages?
Crates.io is the default registry. Cargo also supports alternate registries, Git dependencies, and local path dependencies.
Can Cargo work without network access?
Yes. The --offline option or net.offline setting makes Cargo avoid network access and use locally cached data when possible.
Is Cargo open source?
Yes. Cargo is primarily distributed under the MIT License and Apache License, Version 2.0.
Does Cargo support private registries?
Yes. Cargo includes private registry authentication and credential providers for Windows Credential Manager, macOS Keychain, libsecret, or its token provider.


