Run Sail and Valet in parallel

Constantin Druc ยท 15 Jun, 2021

[00:00] The first thing I'm going to do is to shut down sail. Then I will restart laravel valet, and also mysql using brew services start mysql. Now if I open my browser and go to wordpress.test, here I have a wordpress installation running on Laravel Valet.

[00:34] Now back to the terminal, if I try to start Sail, it will fail because the mysql and http ports are no longer available. However, we can instruct Sail to use different ports. If I open the docker-compose.yml file, we see we have these environment variables. We have the APP_PORT and the FORWARD_DB_PORT. We can set these when we start Sail like so: we can do APP_PORT=81 and we can do FORWARD_DB_PORT=3307 and then sail up -d (APP_PORT=81 FORWARD_DB_PORT=3307 sail up -d).

[01:26] And now Sail should be working with valet in parallel. The difference is, instead of accessing localhost, we'll have to specify the port, which is 81.