Need Assistance?

In only two hours, with an average response time of 15 minutes, our expert will have your problem sorted out.

Server Trouble?

For a single, all-inclusive fee, we guarantee the continuous reliability, safety, and blazing speed of your servers.

How to Add an SSH Key to Laravel Forge: A Step-by-Step Guide

Laravel Forge is a powerful tool for managing and deploying your PHP web applications. One crucial aspect of managing your server on Forge is adding SSH keys for secure access. In this step-by-step guide, we’ll walk you through the process of adding an SSH key to Laravel Forge, ensuring that your server remains secure and accessible.


Before you begin, make sure you have the following:

  1. A Laravel Forge Account: You need an active Laravel Forge account to access your server and manage SSH keys.
  2. SSH Key Pair: If you don’t have an SSH key pair, generate one using the following command on your local machine:
ssh-keygen -t rsa -b 4096
  1. This command will generate a public key ( and a private key (id_rsa). Keep your private key secure and never share it.
Step 1: Log in to Laravel Forge
  1. Open your web browser and navigate to Laraval Forge.
  2. Sign in with your Laravel Forge credentials.
Step 2: Access Your Server
  1. Once logged in, click on the “Servers” tab in the Forge dashboard.
  2. Select the server to which you want to add the SSH key. If you haven’t set up a server yet, follow the Forge documentation to create one.
Step 3: Navigate to the Server’s SSH Keys
  1. In the server management interface, click on the “SSH Keys” tab on the left-hand sidebar.
Step 4: Add a New SSH Key
  1. To add a new SSH key, click the “+ New SSH Key” button.
  2. In the “Name” field, give your SSH key a recognizable name. This is useful if you have multiple keys.
  3. In the “Key” field, paste the contents of your public key ( that you generated earlier.
  4. Click the “Add SSH Key” button to save your new key.
Step 5: Verify SSH Key Addition
  1. After adding the key, you should see it listed in the “SSH Keys” section for your server.
  2. You can now use this SSH key to access your server securely.
Step 6: Access Your Server via SSH
  1. To access your server via SSH using the added key, open your terminal.
  2. Use the following command, replacing <your_server_ip> with your server’s IP address
ssh forge@<your_server_ip>

3. You will be prompted to enter the passphrase for your SSH key (if you set one during key generation). Once entered, you’ll have secure access to your server.

Managing SSH keys is a fundamental aspect of securing your server infrastructure. With this step-by-step guide, you can easily add an SSH key to Laravel Forge and ensure secure, convenient access to your servers. Remember to keep your private key safe and never share it with unauthorized individuals.

Liked!! Share the post.

Get Support right now!

Start server management with our 24x7 monitoring and active support team

Can't get what you are looking for?

Available 24x7 for emergency support.