[Laravel] Can not access site when running Laravel by php artisan

Hi supporter,

I am in deploy the Laravel app on my droplets. I use the php artisan serve to run the server, but I could not access it by IP and port(8000).

Can you give me any ideas?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

It sounds like that the port might not be opened via your firewall. If you are using a firewall like ufw you can open the port with the following command:

ufw allow 8000

Also keep in mind that you might have to bind it on rather than localhost:

php artisan serve --host

That way the Laravel installation will be accessible externally via your server IP as well.

Let me know how it goes. Regards, Bobby