# How to add ssh key to gitlab

> To add an SSH key to GitLab, select your avatar, click Preferences, and choose SSH Keys. Next, generate the key using Command Prompt, enter a passphrase, and follow the instructions. Finally, open the key in Notepad, copy it, paste it into GitLab, and click Add key.

Canonical: https://livedemo.ai/tutorials/how-to-add-ssh-key-to-gitlab/
Apps: GitLab
Updated: 2026-10-05
Interactive demo: https://story-api.livedemo.ai/workspaces/62255d3d3304f17b8f5e2d03/stories/692a2ee2d673bd5aa8e60f98/preview?step=1

## Steps

1. On your Gitlab account select your avatar and click "Preferences."
2. Then choose "SSH Keys."
3. Open Command Prompt and run the command " ssh-keygen -t rsa ." You will be given instructions on where the SSH key will be saved.
4. Enter a passphrase in the Command Prompt to proceed, then follow the subsequent instructions.
5. Find the SSH key, open it on Notepad, and copy it.
6. Paste the SSH key in the space provided and click "Add key."
7. Everything is set, this is now the new SSH key you have generated.
