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

rpombo's avatar

Having trouble deploying Laravel 5 to DigitalOcean

Okay this is my first project, so it is probably a really basic issue, but I just can't deploy files from Github to DigitalOcean. I don't have any problems creating a new server and it shows up fine on DO. I also do not have a problem SSH-ing into DO and seeing the original default/public site. As soon as I hit the "Deploy Now" button I get an error and all site files are removed. My error on Forge is: "We were unable to deploy your project to your server ()."

0 likes
12 replies
rpombo's avatar

The database has been created perfectly and I don't see any other issues.

christiangerdes's avatar

What's the error message from Laravel Forge? You can show the latest deployment log.

rpombo's avatar

Warning: Permanently added the RSA host key for IP address '123.30.123.123' to the list of known hosts.

From github.com:<github/project>

  • branch master -> FETCH_HEAD Already up-to-date. Loading composer repositories with package information Installing dependencies from lock file Nothing to install or update Generating autoload files Generating optimized class loader Compiling common classes

[PDOException]
SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO)

christiangerdes's avatar

That's because you have to update your database configuration to match the right credentials.

It's something like:

username: forge
database: forge
hostname: localhost

you'll receive an mail with the password

1 like
rpombo's avatar

where do I access the database configuration? sorry...

rpombo's avatar

This is a brand new Laravel 5.1 installation without any modifications yet

rpombo's avatar

Thank you, that worked. I feel like such a noob. I have been working with LAMP for years and getting lazy. Now that I am trying to educate myself, I am realizing how lost I really am.... ugh....

showhouse's avatar

@desloc do you know how you would do this on digital ocean without forge? .env is gitignored Can't seem to find any tutorials to deploy from github with a simple pull / clone.

RomainLanz's avatar

You should SSH into your server and create manually the .env file.

1 like

Please or to participate in this conversation.