Windows Install Chocolatey

Windows Install Chocolatey

Chocolatey is a powerful tool that simplifies software management on Windows.

Instead of hunting down installers and dealing with complex setups, Chocolatey lets you install, update, and uninstall software with simple commands.

There are two methods to Install Chocolatey on Windows:

  1. Using PowerShell: Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
  2. Using Command Line: @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command
    "iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"
    && SET "ChocolateyInstall=-"

Prerequisites to Install Chocolatey on Windows

For Chocolatey Installation Windows 10 and Windows 11, make sure your system is meeting the below specifications:

  • A Windows VPS running Windows 10 or later.
  • An administrative command prompt or PowerShell.

Method 1: Windows Chocolatey Install Using PowerShell

As the first method, you will learn How to Install Chocolatey on Windows using PowerShell. To do this, follow the below steps:

Step 1: Open an administrative PowerShell:

  • Press the Windows key.
  • Type “PowerShell
  • right-click on “Windows PowerShell
  • Select “Run as administrator“.

Step 2: Install Chocolatey on Windows

  • Once the Windows Powershell is opened, run the command below:
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

This command downloads and executes the Chocolatey installation script.

You might need to restart your PowerShell session for the changes to take effect.

Step 3: Verify the Installation

Once the installation is complete, open a PowerShell window and type:

choco -?

If Chocolatey is installed correctly, you should see the Chocolatey help information displayed.

Method 2: Install Chocolatey on Windows Using Command Line

If you prefer to work on CMD, follow the below steps to Install Chocolatey on Windows Server:

Step 1: Open an administrative command prompt:

  • Press the Windows key.
  • Type “cmd
  • Right-click on “Command Prompt
  • Select “Run as administrator“.

Install Chocolatey Windows Using Command Line

Step 2: Install Chocolatey on Windows

  • Run the following command into the command prompt window and press Enter:
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command   
 "iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"   
 && SET "ChocolateyInstall=-"

This command uses PowerShell to download and execute the Chocolatey installation script.

To let the changes take effect, restart your command prompt.

Step 3: Verify the Installation

After a successful installation, open a new command prompt and type:

choco -?

Once you view the Chocolatey help information, you can ensure a complete installation.

What is Chocolatey Repository?

A Chocolatey repository is essentially a collection of software packages that can be installed using the Chocolatey package manager. It is like a library of software ready to be checked out.

The default repository is the Chocolatey Community Repository (CCR), which offers a vast array of free software packages.

However, organizations often have specific needs and might require more control over their software distribution.

Why Create and Manage Private Repositories?

By setting up internal repositories, organizations can enhance security, compliance, and efficiency in software management.

This enables you to:

Control package content: Curate software packages specific to your organization’s needs.

Manage package versions: Ensure consistency and compatibility across systems.

Offline installations: Distribute packages without internet access.

Security: Maintain control over software distribution and updates.

How to Use Chocolatey on Windows?

Once Chocolatey is installed, you can start using it to manage your software. It Covers searching, installing, uninstalling, updating, and listing packages.

Here are some basic commands:

  • To Search for a package, run:
choco search <package_name>

For example, to search for notepad:

choco search notepad++

Note: To install multiple packages at once, separate them with spaces. For example:

choco install notepad++ 7zip
  • To Install a package using Chocolatey, you would typically use a command like:
choco install <package_name>

For example, to install Google Chrome, you would use:

choco install googlechrome

Note: You can use the -y flag to automatically confirm installations. For example:

choco install googlechrome -y

To install the Git command line (cli) Client for Windows, type:

choco install git

The following command installs GitHub, the official GUI-based client for Git:

choco install github

To install the popular open-source SSH client, Putty, run:

choco install putty
  • You can also use Chocolatey on Windows to Uninstall a Package:

The main syntax is:

choco uninstall <package_name>

For example, to uninstall vlc, run:

choco uninstall vlc
  • To Update the Chocolaty program, run:
choco upgrade chocolatey
  • Chocolatey can be used to Update a package. To do this, run:
choco upgrade <package_name>

For example, to update Firefox, type:

choco upgrade firefox
  • To List installed packages:
choco list -localonly
  • To View package details:
choco show <package_name>

How to Install the Chocolatey GUI?

If you prefer, ypu can install the GUI version after installing Chocolatey. To do this, run:

choco install chocolateygui

What are the best Advantages of Chocolatey?

Chocolatey is a package manager for Windows that simplifies software management.

It offers numerous advantages including rapid installation, easy updates, and the ability to install multiple packages simultaneously.

Here are the best advantages of Chocolatey:

  • Rapid and efficient software installation.
  • Easy management of software updates and upgrades.
  • Centralized control for consistent software configurations.
  • Powerful automation capabilities through PowerShell integration.
  • Extensive library of software packages for various needs.
  • Time-saving and cost-effective solution for software management.

Why Install Chocolatey on Windows?

Chocolatey is a powerful tool that simplifies software management on Windows.

Here are the most important reasons you need to install and use Chocolatey on Windows:

Streamline software management: Install, update, and uninstall applications with ease.

Save time: Eliminate manual downloads and complex setups.

Maintain consistency: Ensure software is installed uniformly across systems.

Automate tasks: Use PowerShell to script software deployments.

Access a vast library: Choose from thousands of available packages.

What is ‘’ Get-ExecutionPolicy restricted’’ error while installing Chocolatey?

By controlling the requirements for loading configuration files and scripts, this PowerShell safety feature stops dangerous programs from running.

To solve this error, run the command below before installing Chocolatey to Unrestrict the PowerShell execution policy:

Set-ExecutionPolicy AllSigned 

To change the execution policy, type Y when prompted, then hit Enter to confirm.

Security Note for Windows Install Chocolatey

Installing Chocolatey requires administrative privileges. Always download the installation script from the official Chocolatey repository to ensure you’re obtaining the legitimate and secure version.

You can also run the command below to download the installation script from the official Chocolatey website:

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))

Conclusion

By simplifying installation, updates, and removal, Chocolatey saves time and ensures consistency across systems.

To Install Chocolatey on Windows, either use PowerShell or Command Prompt by running the provided command.

Since Chocolatey offers advanced features for experienced users, they can create custom packages to tailor software installations to specific needs or utilize repositories to manage software sources efficiently.

Leave a Reply

Your email address will not be published. Required fields are marked.