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

garynewport's avatar

Installing Laravel within Docker

I want to build a new site using Laravel and Vue. However, I want this to be compartmentalised within Docker. Most instructions appear to require either an existing Laravel site or to first install PHP, etc then compartmentalise. However, I want to have the entirety of Laravel within the Docker compartment. I have installed Docker (on my Mac) and it’s a completely clean Mac (only has VSC and Chrome in addition to standard Mac apps). I have some instructions about creating a Dockerfile and editing the .ENV file but want to ensure I make as few errors as possible. Might someone give me some simple steps and potential pitfalls I might encounter, please?

0 likes
3 replies
aruszala's avatar
aruszala
Best Answer
Level 56

@garynewport take a look at Laravel Sail:

https://laravel.com/docs/11.x/sail

It uses docker under the hood and even generates a docker-compose.yaml file. You could use it as is or modify the docker-compose.yaml file to your liking and deploy it in your own custom environment.

1 like
garynewport's avatar

Thanks for these; it shows that asking is the best! I was using sail about 2 months ago but never made the connection this time around. Thank you.

1 like

Please or to participate in this conversation.