Install OpenSSH Server and Client on Windows 11

This guide provides a straightforward walkthrough for installing and configuring both the OpenSSH Client and OpenSSH Server components on Windows 11. Whether you prefer using the graphical Windows Settings interface or fast command-line execution via PowerShell, you will learn how to enable these tools and start the SSH server service for secure remote access.


Method 1: Install OpenSSH Using Windows Settings

The graphical interface is the simplest method to add optional Windows features.

Step 1: Open Optional Features

  1. Open the Start Menu and click Settings (or press Win + I).
  2. Navigate to System on the left menu, then select Optional features on the right pane.

Step 2: Add OpenSSH Components

  1. Click the View features button next to Add an optional feature.
  2. In the search bar, type OpenSSH.
  3. Select OpenSSH Client (if not already installed) and OpenSSH Server.
  4. Click Next, then click Install.

Windows will download and install the selected components in the background.


Method 2: Install OpenSSH Using PowerShell

PowerShell provides a quick, automated way to install both features.

Step 1: Open PowerShell as Administrator

  1. Right-click the Start Menu icon.
  2. Select Terminal (Admin) or PowerShell (Admin).

Step 2: Check Feature Status

Run the following command to check if the components are already installed:

Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'

Step 3: Install the Client and Server

Both commands should return an output showing RestartNeeded : False and State : Installed.


Configure and Start the OpenSSH Server

After installing the OpenSSH Server, you must start the service and configure it to run automatically on system boot.

  1. Open PowerShell as Administrator.

  2. Set the SSH service startup type to Automatic:

    Set-Service -Name sshd -StartupType 'Automatic'
  3. Start the SSH service:

    Start-Service sshd
  4. Verify that the SSH server is running and listening on port 22:

    Get-Service -Name sshd

Verify Firewall Configuration

The OpenSSH installation automatically creates a firewall rule. To ensure incoming connections on port 22 are permitted, run:

Get-NetFirewallRule -Name *OpenSSH-Server* | Select-Object Name, DisplayName, Enabled, Direction

If the rule is enabled, your Windows 11 machine is ready to accept incoming SSH connections.