Question

How do I deploy my locally hosted Craft CMS site to droplet?

I’m really new to all of this, so trying to problem solve along the way!

My current situation is…

I’ve built my first Craft CMS website and I’m running it locally on my machine using Craft Nitro and Docker – as suggested here… https://craftcms.com/docs/getting-started-tutorial/environment/stack.html#why-nitro

I’m now at the point that I would like to deploy the site to a droplet I have created on Digital Ocean. On the droplet I have spun up a LAMP server (again all firsts for me!)

Ideally, I would like to create a workflow that automatically deploys any changes I make, so with this in mind have uploaded the files and directories to a GitHub directory, hopefully this was the right thing to do?

I have very little idea about what to do next in order to get deploy the site, so would really appreciate any help or guidance!


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I recommend using Laravel Forge to provision the droplet.

Hi there,

What I could suggest is following the deployment best practices suggested by Craft CMS here:

https://craftcms.com/knowledge-base/deployment-best-practices

What you need to do is:

  • Create a new GitHub repository.
  • Then push your local files to that new GitHub repository.
  • After that on your server, using the cd command go to the /var/www/html directory and use clone your repository.
  • Then run the composer install command: composer install --no-interaction
  • After that update your database details in the Craft config file and run your database migration files in case you have them.

An alternative option would be to give the DigitalOcean App Platform a try as that way you would not have to do any server configuration and you would get automated deployments out of the box.

Let me know how it goes! Best, Bobby