Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

seanpeter's avatar

Laravel Spark, Laravel Forge, Digital Ocean, Putty Public and Private Keys and SSH into Server

I am beginner to app development and am in need of help setting up Laravel Spark! I purchased a license for Laravel Spark and I signed up for monthly accounts with Digital Ocean and Laravel Forge.

Initially, I had setup a droplet in Digital Ocean. Then, I had tried connecting Laravel Forge to this droplet, and I observed that Laravel Forge create a new droplet. I then deleted the original droplet.

Now, I am trying to install Laravel Spark, but it appears the first step is to use an SSH Client (e.g., Putty or Bash/Ubuntu since I am on Windows) to login to the server. I have spent a few hours trying to figure out how to login. My investigation has led me to understand that my Digital Ocean username of using Putty to log into "root@my_ip_address" (where my_ip_address is my IP address!) is no longer applicable since I deleted that droplet. I believe I need to login to my new Forge droplet using the "forge" username, i.e. forge@my_ip_address. When I do so, I get the following error: "Disconnected: No supported authentication methods available (server sent: public key)". I suppose this makes sense since the Laravel Forge Server Details panel under SSH indicates, "By default, Forge servers only allow SSH key authentication. Password authentication is disabled."

So, its these SSH public and private keys that are confusing me. I understand that I can use PuTTYgen to generate public and private keys. I have done so and saved both files to my computer. I then edited the public key in Notepad++ and pasted the public key named into Laravel Forge Server Details panel under SSH with the name "Desktop" like below where "..." equals the actual key.

---- BEGIN SSH2 PUBLIC KEY ---- Comment: "rsa-key-20180304" ... ---- END SSH2 PUBLIC KEY ----

I then try to perform the SSH login through Putty to the Laravel Forge droplet and I get the same error as above. I think I am missing a major concept here. Can someone steer me in the right direction?

0 likes
5 replies
seanpeter's avatar

"Assuming you have an SSH key pair, you need to assign your public key to your droplet from within Forge. After that, you should be able to connect via ssh using your private key." https://laracasts.com/discuss/channels/forge/connecting-to-digitalocean-droplet-managed-via-forge-on-windows-with-putty?page=0

In Putty, I am trying to connect with the server using a private key with these steps: 1 Enter the remote server Host Name or IP address under Session. 2 Navigate to Connection > SSH > Auth. 3 Click Browse... under Authentication parameters / Private key file for authentication. 4 Locate the id_rsa.ppk private key and click Open. 5 Finally, click Open again to log into the remote server with key pair authentication. Source: https://devops.profitbricks.com/tutorials/use-ssh-keys-with-putty-on-windows/#connect-to-server-with-private-key

seanpeter's avatar

Does my SSH public key have to be specified in Laravel Forge only or both Laravel Forge and Digital Ocean?

ejdelmonico's avatar

It depends, Forge needs your key for you to use SSH. Password login is disabled for obvious reasons. DO is a totally separate thing. You would have to add it there if you need to do something and didn't use password access. I use Forge/Envoyer for many servers and never had the need to use the DO console if that is any help. As a note, there are plenty of posts from a year or so ago about deploying Spark and not using composer install just for your knowledge.

The way the system works (SSH) is that Forge plants its key when the server is built and you add the Envoyer key if using Envoyer and you add your personal key. All password access is a very high security risk so it is configured as disabled.

vmitchell85's avatar

You'll need to upload your public SSH key into Forge. Once you do that Forge will install your key onto the server for you.

After that is complete you can SSH using your privatekey from your local machine to the server.

As @ejdelmonico mentioned you probably will never need to use the Digital Ocean console.

Please or to participate in this conversation.