Windows+Chocolatey

Configuring a personal development environment via Chocolatey software packages

Purpose

This page provides instructions on how to install and use Chocolatey on Windows.

Prerequisites

  • Windows Administrator privileges
  • Windows 10 or Windows Server 2012 later.

Note: Chocolatey can work on Windows 7 & Server 2003 or later but your mileage will vary, as the community has moved on years ago from EOL OSs.

General Information

Traditionally Windows operating systems have always suffered from the lack of a good and popular package manager in contrast to Linux or even macOS (brew/macports). Chocolatey has been relatively successful in filling this gap for developers by providing a package manager that is easy to use yet solid solution building upon .NET’s NuGet approach.

Instructions

Installing Chocolatey

  1. Load powershell with administrator privileges Press Ctrl & Esc at the same time, search for powershell and then then select ‘Run as administrator’

  1. Run and follow the prompts of the below powershell command, which temporarily disables security policies for the running shell to run an unsigned external powershell script with the privileges needed to install Chocolatey.
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 Packages with Chocolatey

  1. Check the Chocolatey package website for interesting packages https://community.chocolatey.org/packages and then follow the instructions on each page…
  2. Alternatively use choco search application_name to search for packages names and then install them via choco install -y 'package_name'

If I’m installing packages on a fresh Windows OS, I will commonly install the following packages:

for %i in (7zip 7zip.install android-sdk androidstudio autohotkey autohotkey.install autohotkey_l chocolatey-core.extension chocolatey-dotnetfx.extension chocolatey-vscode.extension cpu-z cpu-z.install curl dart-sdk docker-desktop DotNet4.5.2 dotnetfx ffmpeg Firefox flutter gimp git.install github-desktop GoogleChrome grepwin hugo hugo-extended intellijidea-community jdk8 KB2919355 KB2919442 kdiff3 nodejs nodejs.install notepadplusplus.install putty putty.portable Qemu sed sysinternals terraform vagrant vim virtualbox vlc vscode vscode-ansible vscode.install Wget winscp winscp.install); do choco install -y %i

Upgrading Packages with Chocolatey

  1. Load powershell or command prompt with administrator privileges.
  2. Run choco update -y all, this should update all packages without any prompts.

Security considerations

By using Chocolatey you are trusting the community not to be malicious and install malware/spyware on your system. Generally this is ok for a development machine if you have good security controls in place but depending on your appetite for risk or need for security is likely not the right approach for a production server. Since packages for production servers should go through a whitelisting process and be version controlled using artifactory or a similar solution.

  • Chocolatey.org Windows package manager.
  • As an alternative take a look at Scoop which takes a fairly different approach to installing applications in windows.