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

hanifeoglu's avatar

Laravel Sail & Docker Adding Additional Sites (Multi Project)

It is now recommended to use Sail & Docker with Laravel 8

Now I use homestead, but I wanted to upgrade my system to the latest version 8 and I did the setup before I installed the Docker Desktop and Sail http: // localhost everything works, however nodejs npm and mysql redis are ready for everything

The topic I want to learn is sail & docker, how does multiple projects work in this structure? For example Homestead before working on this config

- map: homestead.test
to: /home/vagrant/project1/public

- map: another.test
to: /home/vagrant/project2/public

Thanks

0 likes
3 replies
Sergiu17's avatar
Sergiu17
Best Answer
Level 60

You have two options as far as I know, you either stop the container of project1, then you run sail up for the project2

or if you need to run two projects at the same time, then you have to change the ports in docker-compose.yml,

  • for the project1 use for example localhost:8001

  • for the project2 use for example localhost:8002

4 likes
hanifeoglu's avatar

Thank you so much @sergiu17 You are quite right the first option is enough for me

Best regards

1 like
KiddTang's avatar

@hanifeoglu if you want to go further with custom domain (for some reason)

By using the Nginx Proxy, you can achieve Multiple Project just like Homestead

Here is the step-by-step tutorial you can follow with....

2 likes

Please or to participate in this conversation.