Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install Chocolatey on Windows 10

Chocolatey is a package manager for Windows. Install it with Command Prompt or PowerShell.

Windows Hosting2 min read6 screenshots

What Chocolatey is

Chocolatey installs, updates and removes Windows programs from the command line, like apt on Linux. It helps admins and developers set up machines fast and the same way every time.

Method 1: Command Prompt

Step 1. Open Command Prompt as administrator.

Step 2. Run the official install command from the Chocolatey website. It looks like this:

@"%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://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
Running the install command

What the script does:

  • Turns on TLS 1.2 for web requests.
  • Downloads the latest Chocolatey package.
  • Extracts and installs it.
  • Sets the ChocolateyInstall environment variable.
  • Sets up the package repository.
  • Creates a shim for the choco command.
  • Adds Chocolatey to the PATH.

You may see notes to close and reopen your shell. Do that, then check:

choco -v
The Chocolatey version

Method 2: PowerShell

Step 1. Open PowerShell as administrator.

Step 2. Check the execution policy:

Get-ExecutionPolicy
Checking the execution policy

If it says Restricted, change it.

Step 3. Set the policy. AllSigned is safer, Bypass is less strict:

Set-ExecutionPolicy AllSigned
Setting AllSigned
Set-ExecutionPolicy Bypass
Setting Bypass

Step 4. Run the install command (from the Chocolatey website):

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Installing Chocolatey in PowerShell
Warning: Read any script before you run it. Always get the install command from the official Chocolatey page.

Common commands

CommandWhat it does
choco install <package>Installs a package and what it needs
choco upgrade <package>Upgrades a package (choco upgrade all upgrades everything)
choco uninstall <package>Removes a package
choco search <word>Searches the repository
choco listLists installed packages

Example:

choco install git -y

Use cases

  • DevOps and CI. Install tools on build machines automatically.
  • IT administration. Manage software on many computers.
  • Personal use. Set up a new PC with one script.

Best practices

  • Keep Chocolatey updated: choco upgrade chocolatey.
  • Install packages only from trusted sources.
  • Update your packages often.

Quick recap

  • Run the official install command as administrator.
  • Check with choco -v.
  • Use choco install for software.