FREEDOM251

Freedom251 › Package Managers

Cargo

Free plan LinuxMacWindows

Visit Cargo Alternatives Pricing

Cargo's own site

What Cargo is

Cargo is the command-line package manager and build tool for Rust development. It downloads dependencies, invokes rustc or another build tool with the needed parameters, and helps make builds repeatable with lockfiles. It can compile, check, document, test, run, package, install, and publish Rust packages. The `cargo new` command creates a binary package by default; add `--lib` to create a library. Cargo uses crates.io as its default registry and also accepts packages from alternate registries, Git repositories, and local paths. Workspaces manage one or more packages together with a shared lockfile and output directory. Package features can enable conditional compilation and optional dependencies. Cargo can try to work from cached data without network access when offline mode is enabled. It is included with the Rust toolchain installed through rustup, with installation instructions for Windows, macOS, Linux, and other Unix-like systems. Cargo is open source under the MIT and Apache License, Version 2.0, and is free to use.

Who it suits

Cargo suits developers building Rust packages who want dependency management, build commands, and publishing tools in one command-line utility. Its workspace and offline options also suit projects that need to manage related packages or work from cached data.

What it does well

  • Free Rust package manager and build tool
  • Supports crates.io, alternate registries, Git, and local paths
  • Workspaces share a lockfile and output directory
  • Offline mode can use locally cached data
  • Includes commands for testing, packaging, and publishing

What to know first

  • Some features require nightly Rust and -Z flags
  • Used through a command-line interface

Limits

Some documented Cargo features are unstable and require a nightly toolchain and `-Z` flags.

Plans

PlanBilled and limitsPrice
CargoFree Rust package manager and build toolFree

As doc.rust-lang.org lists them, read 30 Sept 2026. The maker's own page has the final word.

Getting started

  1. Open the Cargo documentation website.
  2. Install the stable Rust toolchain with rustup; Cargo is included.
  3. Use `cargo new` to create a binary package, or add `--lib` for a library.

Cargo is the package manager and build tool for Rust packages, best suited to developers who want one command-line workflow for dependencies and the package lifecycle. It is a strong fit for Rust projects, but not a general-purpose manager for other languages.

Overview

Cargo fetches dependencies, invokes rustc or another build tool with the appropriate parameters, and provides commands to compile, check, document, test, run, package, install, and publish Rust packages. The cargo new command creates a binary package by default; use --lib to start a library. This breadth makes Cargo a practical foundation for routine Rust development, rather than just a way to download libraries.

Projects can depend on crates.io packages, alternate registries, Git repositories, or local paths. Lockfiles help make builds repeatable, and workspaces let related packages share a lockfile and output directory. The trade-off is specialization: Cargo is designed around Rust packages, not development across multiple languages.

Key features

Dependencies, registries, and credentials

Crates.io is the default registry, while alternate registries can be configured in .cargo/config.toml and use Git or sparse protocols. Cargo also supports private registry authentication, with credential providers that can store tokens in Windows Credential Manager, macOS Keychain, or libsecret. Its cargo:token provider stores tokens as unencrypted text, so users should choose a credential provider with storage appropriate to their security needs.

Conditional features can enable optional dependencies or compilation paths, including through command-line flags such as --features. Cargo can also mark a published crate version as yanked, preventing new dependency resolution from selecting it while existing lockfiles continue to use it. These controls give package maintainers useful ways to shape dependencies and handle problematic releases.

Offline builds and extensibility

With --offline or net.offline enabled, Cargo avoids network access and attempts to proceed using locally cached data. That is useful in disconnected environments, though it depends on the needed packages already being cached. New subcommands can extend Cargo without changing Cargo itself, giving teams room to add workflow-specific commands.

The Cargo Book includes a guide, command reference, FAQ, glossary, Git authentication appendix, and changelog. Its CI guide provides build and test examples for GitHub Actions, GitLab CI, builds.sr.ht, and CircleCI. Some documented features remain unstable and require a nightly toolchain and -Z flags, which matters if a project needs functionality beyond the stable release.

Pricing

Cargo is free: the Cargo plan costs free. There is no paid tier or trial to weigh against it; Cargo is open source and primarily distributed under the MIT and Apache License, Version 2.0. The documented rustup installer installs Cargo alongside the stable Rust release.

Platforms

Cargo is available for Linux, macOS, and Windows, with installation instructions also covering other Unix-like systems. Its command-line interface suits developers comfortable working from a terminal. Since Cargo is included with the Rust toolchain, it is a natural choice for Rust development on supported systems.

Who it's for

Cargo is the right choice for Rust developers who need dependency resolution, repeatable builds, package creation, testing, and publishing in one tool. Workspaces and multiple dependency sources also suit projects that combine related packages or use private and Git-hosted dependencies. Developers who need an interface beyond the command line, or a package manager for a different language, should look elsewhere.

Pros and cons

  • Pros: Covers building, testing, documentation, packaging, installation, and publishing, reducing the need to assemble separate tools for these Rust package tasks.
  • Pros: Supports lockfiles, workspaces, private registries, and offline operation, which helps with repeatability and varied development environments.
  • Pros: Free, open source, and included with the Rust toolchain, with support for Linux, macOS, Windows, and other Unix-like systems.
  • Cons: Its focus on Rust packages makes it a poor fit for managing dependencies across other languages.
  • Cons: Some features require nightly Rust and -Z flags, so projects relying on them cannot stay entirely on the stable toolchain.
  • Cons: The cargo:token provider stores credentials as unencrypted text, so users need to choose their credential storage with care.

Alternatives

If you are choosing a package manager outside Rust, compare package managers by language and workflow. For JavaScript, npm is an alternative with a free plan for public package authors and paid options. Python developers can consider uv, while Yarn is another free package manager with no paid plans or usage limits stated. For build workflows, Gradle is a free, open-source build system.

Other language-specific options include pip for Python, Apache Maven for Java projects requiring JDK 8 or later for Maven 3.10, vcpkg for C and C++, and Composer for PHP dependency management. These are alternatives when the project’s language or build workflow calls for them, rather than replacements for Cargo in Rust development.

Verdict

Rust developers who want a free command-line tool for dependencies, builds, and package publishing should choose Cargo. Its broad package workflow, workspace support, and registry flexibility make it the practical fit for Rust projects. Look elsewhere for cross-language dependency management, or check whether a required feature is stable before committing to a stable-only toolchain.

Verdict

Cargo brings package management and common build tasks together for Rust development. Check whether any feature you need is stable, since some require a nightly toolchain and -Z flags.

Questions

How much does Cargo cost?

Cargo is free. Its listed plan is free.

Which systems support Cargo?

Installation instructions cover Windows, macOS, Linux, and other Unix-like systems.

What package sources can Cargo use?

Cargo supports crates.io and alternate registries, Git dependencies, and local path dependencies.

Can Cargo work offline?

Yes. Offline mode avoids network access and attempts to use locally cached data.

Is Cargo open source?

Yes. It is primarily distributed under the MIT License and Apache License, Version 2.0.

What does Cargo do?

It downloads dependencies, builds and packages Rust software, and can publish packages to crates.io.

Facts from Cargo's own pages

Alternate registries
Cargo supports alternate registries configured through .cargo/config.toml and supports git and sparse registry protocols. · doc.rust-lang.org, 28 Sept 2026
Build tool
Cargo invokes rustc or another build tool with the correct parameters to build packages. · doc.rust-lang.org, 28 Sept 2026
CI integrations
The Cargo guide gives build and test examples for GitHub Actions, GitLab CI, builds.sr.ht, and CircleCI. · doc.rust-lang.org, 30 Sept 2026
Command line
Cargo is used through a command line interface. · doc.rust-lang.org, 30 Sept 2026
Commands
Cargo includes commands for compiling, checking, documenting, testing, running, packaging, installing, and publishing Rust packages. · doc.rust-lang.org, 28 Sept 2026
Conditional compilation
Cargo features express conditional compilation and optional dependencies and are enabled with command-line flags such as --features. · doc.rust-lang.org, 28 Sept 2026
Conditional features
Package features allow conditional compilation and optional dependencies, and can be enabled from the command line. · doc.rust-lang.org, 30 Sept 2026
Default registry
Cargo installs crates and fetches dependencies from a registry, with crates.io as the default registry. · doc.rust-lang.org, 28 Sept 2026
Dependencies
Cargo supports dependencies from crates.io, other registries, Git repositories, and local filesystem paths. · doc.rust-lang.org, 30 Sept 2026
Dependency management
Cargo downloads and builds package dependencies and helps ensure repeatable builds. · doc.rust-lang.org, 28 Sept 2026
Dependency resolution
Yes · doc.rust-lang.org, 22 Sept 2026
Extensibility
Cargo supports new subcommands without modifying Cargo itself. · github.com, 28 Sept 2026
Free plan
Yes · doc.rust-lang.org, 22 Sept 2026
Installation
The documented rustup installer installs Cargo alongside the stable Rust release. · doc.rust-lang.org, 30 Sept 2026
Intended users
The Cargo Book presents Cargo as a tool for developing Rust packages. · doc.rust-lang.org, 30 Sept 2026
Lockfile support
Yes · doc.rust-lang.org, 22 Sept 2026
Nightly constraints
Cargo documents some features as unstable and requiring a nightly toolchain and -Z flags. · doc.rust-lang.org, 30 Sept 2026
Offline installation
Yes · doc.rust-lang.org, 22 Sept 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. · doc.rust-lang.org, 28 Sept 2026
Package creation
The cargo new command creates a package and defaults to creating a binary program; --lib creates a library. · doc.rust-lang.org, 28 Sept 2026
Package formats
Rust crates; crates.io packages; alternate registry packages; Git dependencies; local path dependencies · doc.rust-lang.org, 22 Sept 2026
Package yanking
Cargo can mark a published crate version yanked so new dependency resolution avoids it while existing lockfiles continue to work. · doc.rust-lang.org, 30 Sept 2026
Private registry auth
Yes · doc.rust-lang.org, 22 Sept 2026
Purpose
Cargo is the Rust package manager. · doc.rust-lang.org, 28 Sept 2026

Where Cargo stands on Freedom251

Look at these too