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

charleskwakye's avatar

Cant view laravel sail project from localhost or localhost:80/Can not still view project even if port is changed from port:80 to another port in docker-compose.yml file

while following the documentation on how to build a new laravel sail project in docker, I run into an error at command [./vendor/bin/sail up] which shows something was running on port:80. I tried to stop the process running on port:80 but I could not so I changed the port number in the docker-compose.yml file to port:8080 and run the [./vendor/bin/sail up] command again an app was able to run in docker successful but the last output showed app was running on localhost:80 which was weird because I changed it. I tried accessing localhost:8080 but site could not be reached. I tried localhost/localhost:80 but it showed only a text [it works!] which is the apache2 localhost file. I tried docker-build and up, but still the same problem. I also tried docker-compose build --no-cache but still the same error. I also tried following laracast tutorial for sail laracast but still the same.

Any help would be much appreciated :).

0 likes
8 replies
MohamedTammam's avatar

From your docker application there's an icon to open the link for that service in the web, did you try it?

charleskwakye's avatar
charleskwakye
OP
Best Answer
Level 1

@MohamedTammam Thank you. Apparently, I had apche2 running on the localhost. I stopped it and it now displays. But I have to stop apache2 completely to stop it from running even when I reboot but the command is not working.

charleskwakye's avatar

@Sinnbeck No I am not. I do want to uninstall it but it came bundled with the mac so I am a bit cautious. Also after stopping it and rebooting, it did not come up again. Thank you though.

MohamedTammam's avatar

@charleskwakye Glad to hear that, in general you shouldn't use two process with the same port. You can try to change the port of the service in Laravel Sail if it conflict with another process in the future.

If your problem is solved, please close the discussion.

1 like

Please or to participate in this conversation.