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

justnorris's avatar

How to change Valet port?

Is there any way to change the port for Laravel Valet? I'm tired of switching MAMP (for other projects) on and off ?

0 likes
4 replies
bashy's avatar
bashy
Best Answer
Level 65

~/.composer/vendor/laravel/valet/cli/stubs/valet.conf is the file that gets copied to our ~/.valet/Nginx/*.dev virtualhosts.

I guess the only way to modify the port is to change it in the stub and then regenerate the sites? Basically, it uses nginx to serve the sites. So changing listen 80 or listen 443 is what you want.

justnorris's avatar

It seems that that's going to auto-removed whenever I update Laravel. This seems more like a hack than a real configuration option. I guess I'll have to just write an on/off toggle script for now instead.

bashy's avatar

@justnorris Yeah, shame they don't have an option in Valet (PR might be there for it).

Please or to participate in this conversation.