Applies to: Chocolatey CLI 2.7.4 on Windows 10, Windows 11 and Windows Server (steps from the Chocolatey and Microsoft documentation, not tested by us on Windows)
To install Chocolatey, open PowerShell as Administrator and run the official install command from the Chocolatey documentation:
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'))
When it finishes without errors, type choco -? to check that it works, then install software with commands such as choco install git -y. Chocolatey is a package manager for Windows: like apt or dnf on Linux, it downloads, installs and updates programs from the command line, which is handy on a Windows Server that you manage over Remote Desktop.
Before you start
- Administrator rights. According to Chocolatey, the normal install needs an administrative shell. A non-administrative install exists, but Chocolatey calls it a last resort, and many packages need administrator rights anyway.
- .NET Framework 4.8. Chocolatey CLI 2.x requires it. According to Chocolatey, the install script tries to install .NET 4.8 if it is missing.
- A supported version of Windows and PowerShell. According to Chocolatey, the install command below works with every PowerShell version from 2.0 on.
- On a Windows Server VPS, connect with Remote Desktop and log in as Administrator first: how to connect to a Windows VPS using Remote Desktop.
Install Chocolatey with PowerShell
- Click Start, type
PowerShell, right-click Windows PowerShell and choose Run as administrator. - Check the execution policy:
Get-ExecutionPolicy
Chocolatey's instructions say that if this returnsRestricted, you should runSet-ExecutionPolicy AllSignedorSet-ExecutionPolicy Bypass -Scope Process. The install command in step 4 already does the second one for the current window only, so your server's policy stays as it is. More about policies: PowerShell commands and the execution policy on Windows servers. - Optional but sensible: the command downloads a script and runs it immediately. Chocolatey itself asks you to inspect
https://community.chocolatey.org/install.ps1before running it. Open that address in a browser and read it first, as you would with any script from the internet. - Paste the install command from the top of this article and press Enter. Chocolatey says to wait a few seconds for it to complete; if you see no errors, it worked.
- Check the installation:
choco -? choco --version
We downloaded and read the current install.ps1 while writing this article. It finds the latest Chocolatey package on the community repository (version 2.7.4 at the time of writing), unpacks it, installs it to %ALLUSERSPROFILE%\chocolatey (normally C:\ProgramData\chocolatey), adds the bin folder to the PATH and refreshes the PATH of the current window. If Chocolatey is already installed, the script stops with "An existing Chocolatey installation was detected. Installation will not continue." Use choco upgrade chocolatey to update an existing install.
What the three parts of the command do
Set-ExecutionPolicy Bypass -Scope Process -Forcelets this one PowerShell window run the downloaded script. It does not change the machine-wide policy.[System.Net.ServicePointManager]::SecurityProtocol ... -bor 3072adds TLS 1.2 to the protocols .NET may use. Chocolatey's servers need TLS 1.2, and older Windows versions do not always enable it in PowerShell.iex ((New-Object System.Net.WebClient).DownloadString('...'))downloadsinstall.ps1and runs it.
Install from Command Prompt (cmd.exe) instead
Chocolatey also gives a one-liner for an administrator Command Prompt. It starts PowerShell for you and adds Chocolatey to the PATH of the current Command Prompt:
@"%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"
Basic choco commands
choco search git(orchoco find git): search the package repository.choco install git -y: install a package.-yanswers yes to every prompt and, according to Chocolatey, also implies accepting the licence.choco install 7zip notepadplusplus -y: install several packages at once.choco list: show the packages installed by Chocolatey. Since Chocolatey CLI 2.0 this lists local packages only; the old--local-onlyoption was removed and now gives "Invalid argument --local-only. This argument has been removed from the list command and cannot be used." Usechoco searchfor the online repository.choco outdated: show which installed packages have updates.choco upgrade all -y: update everything Chocolatey installed. Note thatchoco upgradeinstalls a package if it is not installed yet.choco uninstall git -y: remove a package.
According to Chocolatey, packages on the community repository are created by people in the community, go through moderation, and usually contain PowerShell instructions that download the software from the vendor's official site when you install it. For servers that matter, look at the package page (maintainer, version, download source) before you install. For organisational use, Chocolatey suggests hosting the Chocolatey package internally and installing from there.
Common problems
- "choco is not recognized as the name of a cmdlet" in a window that was already open before the install: that window still has the old PATH. Close it and open a new PowerShell or Command Prompt.
- "The underlying connection was closed: An unexpected error occurred on a receive." or "The request was aborted: Could not create SSL/TLS secure channel.": according to Chocolatey, these come from TLS 1.2 not being available. Make sure you used the full command (with the
SecurityProtocolpart) and that .NET Framework 4.5 or later is installed. - Script blocked by the execution policy: run the command in PowerShell exactly as shown, including
Set-ExecutionPolicy Bypass -Scope Process -Forceat the start. - Behind a proxy: the install script reads the proxy from the
chocolateyProxyLocationenvironment variable (andchocolateyProxyUserandchocolateyProxyPasswordif it needs a login).
Chocolatey or WinGet?
WinGet is Microsoft's own package manager. According to Microsoft, it is available on Windows 11, Windows 10 (version 1809 and later) and Windows Server 2025, as part of App Installer. On those systems WinGet normally comes with Windows (Microsoft notes it appears after the first user login and that App Installer can be missing), so it is a good first choice. Microsoft does not list Windows Server 2016, 2019 or 2022, so on those versions Chocolatey is the simpler way to get a command-line package manager. You can also use both; just update each program with the tool that installed it, so Chocolatey's own package list stays correct.
Ucartz Windows VPS plans (VPS Pro and Elite) come with the Windows Server licence included, and our engineers install Windows after you order. See Windows VPS hosting.
Related articles: connect to a Windows VPS using Remote Desktop, PowerShell commands and the execution policy, how to install Git on Windows and Windows Server, how to install OpenSSL on Windows.
Official documentation: Chocolatey CLI setup (docs.chocolatey.org), Microsoft: Use WinGet to install and manage applications.