If you’re struggling with managing and maintaining software across your environment, you’re in for a treat. In this article, you’re going to learn how to install Chocolatey and get a handle on your software packages!
In this article, you’ll learn, hands-on, how to install Chocolatey, manage software and get a basic introduction to what makes this product tick.
Related: How to Create Your First Chocolatey Package
Prerequisites
This tutorial is going to be a walkthrough. If you plan to follow along, please be sure you have the following prerequisites fulfilled.
- Windows 10 – The tutorial will use Windows 10 1903.
- Windows PowerShell 5.1 (optional) – Although this isn’t technically required by Chocolatey, it is what all examples in this article will use.
For a full breakdown of all technical requirements, check out the Chocolatey Requirements page.
Installing Chocolatey
When getting started with Chocolatey, your first task will be downloading and installing the Chocolatey client. Technically, Chocolatey has a server component as well but for this article, you’ll be focusing on using the client to download, install and update software.
You can install Chocolatey in many different ways. In this article, you’re going to learn the most common way, using PowerShell.
For a detailed breakdown of installing the Chocolatey client in many different ways, check out the Chocolatey installation guide.
To install Chocolatey, the company provides a handy PowerShell script to execute on your system. Before you run the install script, you should first inspect it before downloading. You can find the script here.
Related: How to Run PowerShell as Administrator
With the PowerShell console open as administrator, download and execute the script all in one command.
The below code snippet:
- Ensures PowerShell can navigate the SSL certificate on the chocolatey.org server
- Downloads the script from https://chocolatey.org/install.ps1
- Runs the script once downloaded
- Adds the %ALLUSERSPROFILE%\chocolatey\bin folder to the PATH environment variable

You may run into an error mentioning an execution policy. If so, your current execution policy may not allow script execution. To remedy this, be sure to relax your execution policy turning it to Unrestricted or RemoteSigned.
Verifying Installation
Once the PowerShell script has finished and you are returned back to the PowerShell console, confirm you can run the Chocolatey client called choco.exe.
When you run choco, you should see the installed version and some basic help information as shown below.
Getting Help
One of the best things about the Chocolatey CLI client is its help system. The built-in help system does an excellent job of documenting all the functionality of Chocolatey.
To access the help system, provide the -?
switch to the choco command as shown below.
You can see the Chocolatey client has various commands where you can perform many different functions to manage software.
If you’re ever stuck trying to figure out how to perform a specific action, check out the help system!
Finding Packages
Once you’ve got the Chocolatey client installed and running, it’s time to see what kind of packages are available to install. The client has three commands that allow you to do just that called list, search
, and find
. These commands scour a Chocolatey repository for available packages or to list packages on your machine.
Below you will find the breakdown and examples found in the help system.
As an example, below is an example of enumerating all packages (list
) installed on a local computer (-lo
).
Inspecting Chocolatey Packages Before Downloading
Before you download a package, you should always understand what that package actually does. Luckily, you have the info
command. This command finds details of packages located on a Chocolatey repository.
With choco info
, you can find package attributes like package author, download count, checksum, source, and more.
Take a look at your options of running choco info
below.
For example, let’s say you need to install Google Chrome and you’ve noticed an available package called googlechrome. Run choco info googlechrome
and notice what kind of information you can find.
Installing Packages
Enough getting information about packages. It’s time to actually get some software installed! To do so, use choco instal
.
The choco install
command is mighty and essential. If there is one command you should remember and become a pro at, it’s this one.
The choco install
command installs a package or a list of packages you provide once you know what you need.
Run choco install --help
to see what your options are.
Keeping Chocolatey Packages Updated
Once a package is installed, you will undoubtedly want to keep it up to date. This is a powerful feature of Chocolatey.
Once you have some packages installed, you will quickly find Chocolatey doesn’t just automatically keep packages updated in the background. The Chocolatey client doesn’t run as a service.
To update installed Chocolatey packages, you must invoke choco
manually every time you need to upgrade. To do so, run the choco upgrade
command along with the package you need to upgrade.
The upgrade
command will install the package if the package doesn’t exist on the system.
Below you will find the breakdown and examples found in the help system.
You can upgrade all packages to the latest version by running
choco upgrade all
.
Finding Local, Outdated Packages
What if you want to check if there is a new version of your package before you blindly run choco upgrade
? You can use the outdated
command. The outdated
command scans through your installed packages and cross-references your designated package repository for potential package updates.
Take a look at what’s possible with choco outdated --help
below.
For example, if you want to find all of the locally-installed packages that are out of date, you can do so using choco outdated
.
Suppressing Package Updates
Keeping software up to date is definitely recommended but what if you have packages where you need to explicitly prevent that? Why would you want to do that?
One reason for suppressing updates would be to avoid update redundancy. For example, perhaps you may have just been looking to automate the initial install of a package. You don’t want to maintain the package’s entire software lifecycle.
Perhaps you need to make some exclusions when forcing Chocolatey to update all packages. In that case, you can pin packages.
When you run various Chocolatey commands, you will see a pinned attribute. For example, when running the outdated
command, you can clearly see that attribute as shown below.
Below you will find the breakdown and examples found in the help system
Uninstalling Chocolatey Packages
Finally, perhaps you’ve decided you no longer need software installed. Rather than manually going into Control Panel, finding the software, and removing it that way, use the choco uninstall
command to make quick work of it.
The choco uninstall
command removes one or many software packages all in one swoop.
Notice how to use the choco uninstall
command via the help content below.
Playing it Safe Before Making Changes (choco whatif
)
Automating software management can be a destructive task if not performed properly. Rather than making a lot of changes at once, it’d be smarter to first run a test to see what would have happened. Luckily, the Chocolatey client has a few parameters to do just that.
The WhatIf
Switch
Every choco command has a switch called --whatif
with aliases of --noop
and --what-if
. If these switches are used with a choco command, Chocolatey won’t actually perform the action but inform you what would have happened.
You can see an example below attempting to uninstall all packages on the local system but using the whatif
switch to prevent actually doing anything.
Confirming Actions
When you run choco install
to install a package, you’re typically prompted to confirm if you want the installation process to continue. Choco also requires confirmation for additional packages that get called as a dependency for your initial package.
You can see below an example of how Chocolatey first prompts to install Firefox before actually performing the action.
The confirmation process is a failsafe, but it can slow you down. If you want the process to continue uninterrupted, add a switch of -y, --yes
or --confirm
at the end of your command.
Using the
-y
switch works well when running commands unattended such as in a scheduled task.
Next Steps
Now that you know how to install Chocolatey and use it at a high-level, where do you go from here? Now try to find a common piece of software you typically have to install and upgrade over and over again.
Try to build a script to manage that piece of software with Chocolatey to get your feet wet and begin learning more about this handy Windows package manager!