Chocolatey

On this page 7

Chocolatey is a package manager for Windows that installs, upgrades, configures and removes software through simple commands such as choco install and choco upgrade, instead of downloading and clicking through individual setup wizards. It belongs to the toolset of PowerShell & command line administration, because every Chocolatey package is essentially a PowerShell-driven installation script wrapped in a standardized, versioned archive.

The tool fills a gap that Windows historically left open: unlike Linux distributions, the operating system shipped for decades without a central, scriptable software repository. Chocolatey brings that model to desktops and servers, which makes it valuable for repeatable workstation builds, developer environments and fleet maintenance.

How Chocolatey packages work

A Chocolatey package is a .nupkg file, the same container format used by NuGet in the .NET ecosystem. Inside sits a .nuspec manifest with metadata (identifier, version, dependencies, license) and a tools folder that usually holds chocolateyInstall.ps1, the script that performs the actual installation.

Most packages do not contain the application itself. Instead, the install script downloads the vendor installer from its official location, verifies a SHA-256 checksum, and runs the installer with silent switches such as /S, /qn or /VERYSILENT. Packages that embed the binaries are called embedded packages; they are larger but independent of vendor download links.

The client installs into C:\ProgramData\chocolatey by default, keeps a record of installed packages in its lib folder and creates shims, small executables in a shared bin directory that point to the real program files. Because that directory is on the system PATH, command-line tools become available immediately without editing environment variables for each one.

The following table maps the main components to their role in a typical installation.

ComponentLocation or formatRole
Package.nupkg archiveVersioned unit of distribution
Manifest.nuspec XML fileMetadata, dependencies and version
Install scriptchocolateyInstall.ps1Downloads, verifies and runs the installer
SourceFeed URL or file shareRepository the client queries
ShimProgramData\chocolatey\binExposes executables on the PATH
Configurationchocolatey.configSources, features and cache settings
Core components of a Chocolatey installation

Essential choco commands and options

The choco executable follows a verb-and-argument syntax, and most operations need an elevated session because they write to Program Files and the machine-wide registry. Adding -y confirms all prompts, which is mandatory in unattended scripts and deployment pipelines.

The commands below cover the bulk of day-to-day administration.

CommandPurposeUseful option
choco installInstalls one or more packages–version to pin a release
choco upgrade allUpdates every installed package–except to exclude items
choco uninstallRemoves a package and its program-x to remove dependencies
choco listShows locally installed packages–limit-output for parsing
choco searchQueries configured sources–exact for one identifier
choco pin addBlocks upgrades of a package-n to name the package
choco outdatedLists packages with newer versions–ignore-pinned
Frequently used commands

For complete machine builds, administrators often keep a packages.config file that lists every required application and version, then apply it with a single choco install packages.config -y. This turns a workstation definition into a version-controlled text file that can be reviewed like code.

Chocolatey compared with winget and other installers

Chocolatey is one of several ways to automate software on Windows, and the right choice depends on who maintains the packages and how much control the organization needs. Its closest neighbor is winget, the Windows Package Manager that Microsoft ships with current Windows releases.

The comparison below summarizes the practical differences.

MethodPackage formatStrengthMain limitation
ChocolateyNuGet with PowerShell scriptsMature ecosystem, flexible scriptingCommunity packages vary in quality
wingetYAML manifestsBuilt into Windows, Microsoft-curated repositoryLess scripting during installation
ScoopJSON manifestsPer-user installs without elevationWeaker fit for system-wide software
Intune or Configuration ManagerWin32 app or MSICentral policy and reportingHeavier infrastructure and licensing
Manual MSI deploymentWindows Installer databaseNative and predictableNo dependency or update handling
Chocolatey and alternative software deployment methods

Many enterprises combine the approaches: Intune or Configuration Manager delivers the Chocolatey client and a list of packages, while Chocolatey performs the actual installations from an internal repository. This keeps central reporting while reusing existing package scripts.

Repositories, editions and business use

The default source is the Chocolatey Community Repository, a public feed with thousands of packages maintained largely by volunteers. Each new version passes automated validation, a virus scan and, for many packages, a human moderation step, yet the repository still depends on community maintainers who may lag behind vendor releases.

For organizations, the recommended practice is an internal package repository hosted on a NuGet-compatible server such as a file share, Nexus, ProGet or Azure Artifacts. Packages are internalized, meaning the vendor installer is downloaded once and embedded, so endpoints never reach external sites and builds remain reproducible even when a vendor changes its download link.

Chocolatey is distributed in several editions that differ in automation and management features.

EditionTypical audienceNotable capabilities
Open source clientIndividuals and small teamsCore install, upgrade and source management
ProPower usersDownload caching and private CDN access
For BusinessOrganizationsPackage Builder, internalizer, self-service
Central ManagementLarge fleetsReporting and deployments across endpoints
Chocolatey editions and typical audience

Security risks and common mistakes

Because every package runs a script with administrative rights, installing a package is equivalent to running unreviewed code as an administrator. The main defense is controlling the source: trusted organizations disable the public feed on managed machines and publish only reviewed packages internally.

The table lists frequent problems, their causes and the corresponding fixes.

SymptomLikely causeFix
Checksum mismatch errorVendor replaced the installer fileUpdate the package or internalize it
Upgrade breaks an applicationUnpinned critical softwarePin versions and test before rollout
Program installed twiceSoftware also self-updatesDisable vendor auto-update or exclude it
Access denied during installNon-elevated sessionRun the shell as administrator
Bootstrap script blockedRestrictive execution policyUse a process-scoped bypass only for setup
Typical problems and remedies
  • Never disable checksum validation globally to work around a failing package.
  • Treat choco upgrade all on servers as a change that needs a maintenance window.
  • Remember that Chocolatey tracks only software it installed; existing programs remain unmanaged unless they are adopted through a package.

Stripped to the essentials

Chocolatey works like an app store you control by typing. Instead of visiting ten websites, downloading ten installers and clicking Next many times, you type one command and Chocolatey fetches and installs everything for you.

It also remembers what it installed, so a second command can update all of those programs at once. For anyone who sets up computers often, this saves hours and makes every machine end up the same.

Where it is applied

An IT team at a mid-sized engineering firm onboards about fifteen new developers each month. Previously, a technician spent roughly half a day per laptop installing Git, Visual Studio Code, Node.js, Python, 7-Zip, a browser and a PDF reader, and each machine ended up with slightly different versions.

The team now keeps a packages.config file in a Git repository and hosts internalized packages on an internal NuGet feed. After imaging, a technician runs one elevated PowerShell command; about twenty packages install in under 30 minutes without supervision. A scheduled task runs choco upgrade all -y --except with pinned build tools every week, so security patches arrive automatically while compiler versions stay fixed. The result is identical, documented developer workstations and far fewer support tickets caused by version drift.