How to deploy a Laravel App from local Laravel/Sail Docker Image?

The Laravel/Sail Docker development environment works great on my local computer. However I can’t figure out how to push this to the server. I am use to git repositories and am new to docker.

After pushing my local image (sail-8.0/app) to docker hub, I have pulled it to a DO/Docker server. Running the image is creating lots of errors.

While I find lots of tutorials on how to create a Docker image, I am not finding much on deploying the image to a server. It seems like I need to create a database and change some settings specific to the server. Sail on my local computer has a database, redis, and mailhog container in addition to the app container. I can’t even find links saying this is a bad idea. The Laravel/Sail website does not talk about deployment to the server. Please point me to the correct reosurce/guide.


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

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.

Hi there @dmh,

I believe that Laravel Sail is only used for local development.

Once you are ready to deploy your application to production, you could do one of the following:

  • Use LaraSail (it is a different tool for server configuration) to set up your server and then as you mentioned via Git you could pull your project to the new server:

  • If you do not want to deal with server configuration and maintenance, you could use the DigitalOcean App platform. That way all that you would need to do is to push your Laravel project to GitHub and the deployments would be automatic:
  • Alternatively, you could also create a Docker Image, push it to Docker Hub and deploy from there.

Let me know if you have any questions. Regards, Bobby