Logo

Install Chocolatey: package manager for Windows

Install Chocolatey: package manager for Windows

Install, update and uninstall your Windows software from the command line, exactly like `apt` on Linux. Chocolatey transforms Windows VPS administration by automating the installation of Node.js, Python, Git, 7-Zip, and 9000+ other applications.

Introduction

Chocolatey is THE package manager for Windows. Instead of manually downloading each installer, you type choco install nodejs and you're done. Perfect for:

  • Automating a new VPS setup (provisioning)
  • Keeping 30 apps up to date in a single command
  • Scripting repeatable deployments

Comparable to apt, dnf or brew, but for Windows.

Prerequisites

  • Windows Server 2019/2022/2025 or Windows 10/11 VPS
  • Administrator access via RDP
  • PowerShell 5.1 or later
  • Internet connection

Step 1: Installation

Open PowerShell as administrator (right-click Start → PowerShell (Admin)).

Check PowerShell version:

$PSVersionTable.PSVersion

Must display at least 5.1.

Allow script execution (temporarily):

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'))

Install takes about 30 seconds.

Step 2: Verify installation

Close and reopen PowerShell (still as admin):

choco --version

Must display the Chocolatey version (e.g. 2.x.x).

Step 3: Install a first package

choco install nodejs -y

The -y auto-accepts all confirmations.

Check:

node --version
npm --version

Find an available app:

choco search visual-studio-code

Or directly in the web catalog: https://community.chocolatey.org/packages

Step 5: Install several packages at once

Perfect for provisioning a new server:

choco install git nodejs python3 7zip notepadplusplus googlechrome firefox vscode -y

Chocolatey downloads and installs everything in parallel.

Step 6: Update packages

Update a single package:

choco upgrade nodejs -y

Update ALL installed packages:

choco upgrade all -y

Step 7: Uninstall a package

choco uninstall nodejs -y

Step 8: List installed packages

choco list

Detailed view:

choco list --local-only --include-programs

For a full export (useful to clone the config on another server):

choco export --output-file-path="C:\packages.config"

On a new server, reinstall the full list:

choco install packages.config -y
# Base tools
choco install git curl wget jq 7zip notepadplusplus -y

# Editors
choco install vscode sublimetext4 -y

# Languages
choco install nodejs python3 golang dotnet-sdk -y

# Network / Sysadmin
choco install wireshark putty winscp filezilla mremoteng -y

# Database
choco install mysql.workbench postgresql dbeaver -y

# Containers
choco install docker-desktop kubectl helm -y

# Productivity
choco install firefox googlechrome adobereader -y

Step 10: Automate with a script

Create C:\Scripts\setup-vps.ps1:

# Force admin execution
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
    Write-Host "Run this script as administrator" -ForegroundColor Red
    exit
}

# Install Chocolatey if missing
if (-Not (Get-Command choco -ErrorAction SilentlyContinue)) {
    Set-ExecutionPolicy Bypass -Scope Process -Force
    [System.Net.ServicePointManager]::SecurityProtocol = 3072
    iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
}

# Packages list
$packages = @(
    "git",
    "nodejs",
    "python3",
    "7zip",
    "notepadplusplus",
    "vscode",
    "putty",
    "winscp"
)

foreach ($pkg in $packages) {
    Write-Host "Installing $pkg..." -ForegroundColor Cyan
    choco install $pkg -y --no-progress
}

Write-Host "Setup complete!" -ForegroundColor Green

Run:

& C:\Scripts\setup-vps.ps1

Troubleshooting

"Choco command not recognized" after install

Close and reopen PowerShell. If the problem persists, manually add to PATH:

$env:Path += ";C:\ProgramData\chocolatey\bin"

Download failure (HTTPS/TLS)

Force TLS 1.2:

[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072

Corporate firewall blocks Chocolatey

Configure a proxy:

choco config set proxy http://proxy.company.com:8080

Package blocked by antivirus

Exclude C:\ProgramData\chocolatey\ from Windows Defender:

Add-MpPreference -ExclusionPath "C:\ProgramData\chocolatey"

Useful commands

# General help
choco --help

# Package info
choco info nodejs

# Available versions
choco search nodejs --all-versions

# Install specific version
choco install nodejs --version=18.17.0 -y

# Pin a version (prevent auto-update)
choco pin add -n nodejs --version=18.17.0

# List pinned packages
choco pin list

# Clear cache
choco cache remove

# Package source (URL/repo)
choco source list

Conclusion

Chocolatey radically transforms Windows VPS administration. Configuring a new server now takes 10 minutes instead of a day. Going further:

  • Host your own internal Chocolatey repository (enterprise)
  • Combine with Ansible/Puppet/Chef for multi-machine provisioning
  • Use Boxstarter to script the full install (Chocolatey + packages + Windows config + auto-reboots)

Resources

Join our Discord community server

For any questions, suggestions, or just to chat with the community, join us on Discord!

900+Members