Search code examples
phplaraveldockerubuntularavel-sail

why is Laravel Sail docker not running on localhost


I downloaded docker for windows, installed it and it works fine, I Created a new Laravel Project and installed Sails and it installed properly,

but when I run the sails up command (sails as an alias), then go to the browser and enter localhost, it takes me to and ubuntu page and not the Laravel home page, if I use Laravel.test, i get the error page of not found.

how can i solve this.

                                                   .[[enter image description here](https://i.sstatic.net/AmBIY.jpg)](https://i.sstatic.net/uYH2a.jpg)

Solution

  • You can try to edit your APP_PORT in your .env file like this:

    APP_PORT=3001 // or any number port you like
    

    After that you can re-run your sail command:

    sail up
    

    Now, you should be able to access your site in localhost:3001.

    The reason why your sail up command failed may be because your PORT number 80 already taken from some other software like nginx or apache