How to Use Chocolatey Package Manager on Windows

Updated on 13 May, 2025
Learn how to use Chocolatey, a Windows package manager, for easy software deployment and environment setup with simple commands.
How to Use Chocolatey Package Manager on Windows header image

Chocolatey is a command-line package manager for Windows that simplifies the process of installing, updating, and managing software. It automates what would typically require manual downloads and setups, making it especially useful for system administrators, developers, and power users.

This article explains how to install Chocolatey, manage software packages using simple commands, and streamline your Windows environment setup. Whether you're deploying tools on a personal machine or provisioning multiple systems, Chocolatey helps you save time and ensure consistency.

The Short Answer Version

For a swift overview, here are some essential Chocolatey commands:

# Check Chocolatey version
choco --version

# Search for a package
choco search <package-name>

# Install a package
choco install <package-name> -y

# Install multiple packages
choco install <package1> <package2> -y

# Upgrade a package
choco upgrade <package-name> -y

# Uninstall a package
choco uninstall <package-name> -y

# List installed packages
choco list --local-only

Installing Chocolatey

Chocolatey supports installation via either Command Prompt or PowerShell. Both methods are nearly identical in behavior, but PowerShell offers more flexibility for automation scripts. In either case, administrative privileges are required. Once installed, you can immediately begin managing packages from the terminal.

Using Command Prompt

This method is ideal if you're already working in a Command Prompt environment. It uses PowerShell internally to execute the Chocolatey installation script.

  1. Open Command Prompt as Administrator.

    • Press Win + X and select Command Prompt (Admin).
  2. Run the following command:

    pwsh
    @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
    

Using PowerShell

This method is best for users comfortable with PowerShell or those planning to automate installation across systems. It explicitly sets the execution policy to allow script execution.

  1. Open PowerShell as Administrator.

    • Press Win + X and select Windows PowerShell (Admin).
  2. Run the following command:

    pwsh
    Set-ExecutionPolicy Bypass -Scope Process -Force; `
    [System.Net.ServicePointManager]::SecurityProtocol = `
    [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; `
    iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
    

After installation, verify Chocolatey is installed.

pwsh
choco --version

You should see output similar to:

0.12.1

Chocolatey Command Options

Command Description
choco install <pkg> Installs the specified package
choco install <pkg1> <pkg2> Installs multiple packages in one go
choco upgrade <pkg> Upgrades the specified package
choco upgrade all Upgrades all installed packages
choco uninstall <pkg> Uninstalls the specified package
choco list --local-only Lists all locally installed Chocolatey packages
choco pin add -n=<pkg> Pins a package to prevent upgrades
choco pin remove -n=<pkg> Removes the pin from a package
choco info <pkg> Shows details about the specified package
choco install packages.config Installs packages from a config file

Managing Packages with Chocolatey

Once installed, Chocolatey makes managing software on Windows effortless. You can install, upgrade, and uninstall software packages using intuitive commands. This section explains how to handle individual and bulk operations to simplify your software management workflow.

Installing Packages

Installing packages with Chocolatey is as simple as typing a single command. Whether you're installing one application or provisioning an entire environment, the same syntax applies.

  • To install a package, open an elevated Command Prompt or PowerShell window and run:

    pwsh
    choco install <package-name> -y
    
  • You can also install multiple packages in a single command to streamline setup:

    pwsh
    choco install <package1> <package2> <package3> -y
    

Upgrading Packages

Upgrading software is just as simple. You can upgrade individual packages or all packages at once, ensuring your system stays current with the latest versions.

  • To upgrade a specific package:

    pwsh
    choco upgrade <package-name> -y
    
  • To upgrade all installed packages:

    pwsh
    choco upgrade all -y
    

Uninstalling Packages

Uninstallation is just as seamless as installation. Whether you're removing a single tool or cleaning up multiple outdated programs, Chocolatey handles it cleanly from the terminal.

  • To uninstall a package, run the following command from an elevated Command Prompt or PowerShell session:

    pwsh
    choco uninstall <package-name> -y
    

Listing Installed Packages

Need to see what's already installed? Chocolatey can list all managed packages, giving you a snapshot of your current environment.

  • To view all installed packages:

    pwsh
    choco list --local-only
    

Advanced Usage and Tips

Conclusion

In this article, you learned how to install and use Chocolatey, a package manager for Windows that simplifies software deployment and maintenance. You explored multiple installation methods using Command Prompt and PowerShell, installed and removed packages using simple commands, and explored advanced functionality such as version pinning and config-based batch installation.

To explore more functionality, including upgrade options, version pinning, and advanced flags, run: choco /? or visit the official Chocolatey documentation for in-depth guidance and package development tips.

Comments

No comments yet.