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

Calculate your savings
unxBuild

Create SSH Key on Windows: PowerShell, CMD, and PuTTYgen

Sean

Platform Writer

Jul 05, 2026
5 min read

Create SSH key on Windows with ssh-keygen -t ed25519 in PowerShell or CMD. The key lands in $HOME\.ssh\id_ed25519. The team that uses PuTTYgen only needs it for legacy .ppk format. The team that uses native OpenSSH (modern Windows 10+) has the same workflow as Linux/macOS.

Create SSH Key on Windows: PowerShell, CMD, and PuTTYgen

Table of contents

PowerShell: the modern path

Open PowerShell and run:

ssh-keygen -t ed25519 -C "[email protected]"

The key lands in $HOME\.ssh\id_ed25519 with the public key at $HOME\.ssh\id_ed25519.pub. The team that uses native OpenSSH (Windows 10 1809+) has the same command as Linux/macOS.

CMD: same command, different shell

ssh-keygen -t ed25519 -C "[email protected]"

Same binary, same path (%USERPROFILE%\.ssh\id_ed25519). The team that prefers CMD has this working in CMD too.

PuTTYgen: only for .ppk output

The team that needs a .ppk file for PuTTY or older WinSCP:

  1. Launch PuTTYgen (in C:\Program Files\PuTTY\puttygen.exe).
  2. Parameters: ed25519, 256 bits.
  3. Generate, move mouse to seed randomness.
  4. Save private key as .ppk.

The team that uses native OpenSSH clients doesn’t need PuTTYgen at all.

Copying the key to GitHub/GitLab

GitHub’s SSH key docs walk through adding the key. The flow:

  1. Generate key.
  2. cat ~/.ssh/id_ed25519.pub and copy.
  3. Paste into GitHub’s ‘New SSH key’ form.
  4. Test: ssh -T [email protected].

Troubleshooting ssh-keygen not found

On older Windows or minimal installs:

# Install OpenSSH client
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

Or via Settings -> Apps -> Optional Features -> Add an optional feature -> OpenSSH Client.

The team that has Git for Windows installed already has ssh-keygen available at C:\Program Files\Git\usr\bin\ssh-keygen.exe.

Adding to ssh-agent

After generation, add the key to the agent so passphrase isn’t prompted every connection:

# Start the agent (one-time)
Set-Service ssh-agent -StartupType 'Automatic'
Start-Service ssh-agent

# Add the key
ssh-add $HOME\.ssh\id_ed25519

The team that uses the agent has one passphrase prompt per session instead of per connection.

FAQ

Where does ssh-keygen save the key on Windows?

C:\Users\<you>\.ssh\id_ed25519 (and .pub). Show hidden files in Explorer to see the .ssh folder.

Do I need to convert the key for PuTTY?

Yes if you want a .ppk file. PuTTYgen’s Conversions -> Import key, then save as .ppk. The team that uses native OpenSSH clients doesn’t need this.

Can I use the same key for multiple services?

Yes, but the team that uses one key per service (github, gitlab, work-server) has better isolation. A compromised GitHub key doesn’t give access to the work server.

What if ssh-keygen is not recognized?

Install OpenSSH client via Add-WindowsCapability or Settings -> Optional Features. Or use Git for Windows’s bundled ssh-keygen.

Do I need a passphrase?

Yes for personal keys. No for CI/CD (use secret-scanning instead). The team that uses a memorable 4-word passphrase (correct horse battery staple) has security without friction.

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#windows#ssh-keygen#dev-infra