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

cloud4bpm's avatar

Problem connecting to my Server from Laravel Forge to DigitalOcean

Hi,

Anyone had problems with the deployment on Laravel Forge?

it gives me the following error:

We were unable to deploy your project to your server.

Also, the time to provisioning my DigitalOcean within Forge was aproximately 7 min.

The error that it gives me is related with the SSH key that I copy from my computer to connect to the server. The same that I used on DigitalOcean.

Thanks for advanced.

0 likes
5 replies
jbrooksuk's avatar

Forge doesn't use your SSH key to deploy, it adds its own to your server. Have you ever had a successful deployment with Forge?

cloud4bpm's avatar

Thanks for your reply @jbrooksuk, yes and I received one email to my email account from Bitbucket with another SSH Key to connect to my repositories.

Is needed to add to Forge that key?

jbrooksuk's avatar

In which case Forge should already have added your SSH key for you - it does so for me. Have you since changed id_rsa or id_rsa.pub manually on your server?

cloud4bpm's avatar

It doesn't added the key for me, only created one when I use bitbucket to add the repository (different from the id_rsa that I created to connect to my Digital Ocean servers).

Seems to be the env variables used to connect to the forge@servername database.

If I have working inside my dev machine, how can I configure environment variables to production?

cloud4bpm's avatar

Yeah, when you edit your .env vars within Forge you can deploy fine.

I copy all my .env vars to the Forge .env file but something I don't understand, why is used APP_ENV=local as well in the Forge environment and it does work?

Please or to participate in this conversation.