Migrate to RunxBuild and earn up to $50 in hosting credit on your first deposit.

Calculate your savings
unxBuild

Creating an SSH Key on Windows: PowerShell, OpenSSH, and ssh-agent

Sean

Platform Writer

Jul 06, 2026
5 min read

Create an SSH key on Windows with the built-in OpenSSH client. The right PowerShell command is ssh-keygen -t ed25519. The right agent setup is Start-Service ssh-agent and ssh-add. The team that has this set up has SSH that works from PowerShell, CMD, VS Code, and Windows Terminal without installing any third-party tool.

Creating an SSH Key on Windows: PowerShell, OpenSSH, and ssh-agent

Table of contents

The right command

The right way to create an SSH key on Windows in PowerShell:

ssh-keygen -t ed25519 -C "alice@workstation"

The command prompts for a file location and passphrase. The right answer is to use the default location and to set a passphrase.

Starting the agent

The right way to start the ssh-agent on Windows:

Set-Service ssh-agent -StartupType Automatic
Start-Service ssh-agent
ssh-add $env:USERPROFILE\.ssh\id_ed25519

Adding the key to a server

The right way is ssh-copy-id:

ssh-copy-id alice@server

Or copy the public key manually:

Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub | Set-Clipboard

Then paste into ~/.ssh/authorized_keys on the server.

The right SSH config

The right way to configure the SSH client on Windows is ~/.ssh/config. The right defaults:

Host *
  AddKeysToAgent yes
  IdentityFile ~/.ssh/id_ed25519

FAQ

Does Windows 10 have OpenSSH?

Yes, since version 1809. The right answer is to enable it in Settings → Apps → Optional features.

Can I use PuTTY?

Yes, but the right answer is to use the built-in OpenSSH. The wrong answer is to install PuTTY when OpenSSH is already there.

How do I add the key to GitHub?

Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub | Set-Clipboard, then paste into GitHub → Settings → SSH and GPG keys.

What if ssh-keygen is not found?

Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0.

How do I see the key fingerprint?

ssh-keygen -l -f $env:USERPROFILE\.ssh\id_ed25519.

Can I use WSL2 instead?

Yes, but the right answer is to use both — WSL2 for Linux-specific scripts, native Windows OpenSSH for general SSH.

If you are sizing the infrastructure for the kind of project this post covers, the RunxBuild hosting calculator is the right place to model the line items. The compute, the memory, the storage, the bandwidth, the database - each one is a separate number, and the team’s mental model for the platform is the sum of those numbers. The RunxBuild dashboard is where the team sees the actual usage in one place.

Useful related references:

#ssh#creating#dev-infra#tutorial