LinuxCommandLibrary

valet

TLDR

Install Valet

$ valet install
copy
Register current directory for all sites
$ valet park
copy
Link current directory as site
$ valet link [site-name]
copy
Serve site over HTTPS
$ valet secure [site-name]
copy
Share site publicly via ngrok
$ valet share
copy
Switch PHP version globally
$ valet use php@[8.2]
copy
Isolate site to specific PHP version
$ valet isolate php@[7.4]
copy

SYNOPSIS

valet command [options]

DESCRIPTION

valet is Laravel's minimalist development environment for macOS. It configures your Mac to run Nginx in the background, using DnsMasq to proxy all requests on the *.test domain to local sites.
Valet provides a lightweight alternative to full VM or container-based stacks. It uses minimal resources while enabling instant site access at project-name.test URLs. The park command registers an entire directory, automatically serving each subdirectory as its own site.
Sites can be served over HTTPS with automatic certificate generation, shared publicly via tunneling services, and configured with different PHP versions per-project.

COMMANDS

install: Install and configure Valet (Nginx, DnsMasq).
park: Register directory for wildcard site serving.
link name: Link current directory as named site.
unlink name: Remove a linked site.
links: List all linked sites.
secure site: Serve site over HTTPS.
unsecure site: Revert to HTTP.
share: Share site publicly via ngrok or Expose.
use php: Switch global PHP version.
isolate php: Pin site to specific PHP version.
unisolate: Remove PHP version isolation.
php args: Proxy to site's configured PHP.
composer args: Proxy to site's configured Composer.
restart: Restart Nginx and DnsMasq services.
stop: Stop Valet services.
start: Start Valet services.
trust: Add sudoers entries for passwordless commands.

CAVEATS

macOS only. Requires Homebrew and PHP. Port 80 must be available (no Apache or other servers running). The *.test domain is hardcoded by default but can be changed.

HISTORY

Laravel Valet was created by Taylor Otwell and the Laravel team as a zero-configuration development environment for macOS. It emerged as a simpler alternative to Homestead (Vagrant-based) for developers who prefer native performance. Community forks exist for Linux (Valet Linux) with similar functionality.

SEE ALSO

nginx(8), php(1), composer(1), brew(1)

Copied to clipboard