Command reference
Commands marked with sudo ask for your password — Valet calls sudo itself. Never prefix Valet commands with sudo.
Installation & maintenance
| Command | Description | sudo |
|---|---|---|
valet install [--mariadb] [--ignore-selinux] |
Install the Valet services | ✓ |
valet uninstall |
Uninstall the Valet services | ✓ |
valet update |
Update Valet Linux+ and clean up cruft | |
valet is-latest |
Determine if this is the latest version of Valet | |
valet --version |
Show the installed version |
Services
| Command | Description | sudo |
|---|---|---|
valet start [services...] |
Start the Valet services | ✓ |
valet restart [services...] |
Restart the Valet services | ✓ |
valet stop [services...] |
Stop the Valet services | ✓ |
valet status |
View Valet service status |
Sites
| Command | Description | sudo |
|---|---|---|
valet park [path] |
Register the current (or given) directory with Valet | |
valet paths |
Get all of the paths registered with Valet | |
valet forget [path] |
Remove the current (or given) directory from Valet's paths | |
valet link [name] |
Link the current working directory to Valet | |
valet unlink [name] |
Remove the specified Valet link | |
valet links |
Display all of the registered Valet links | |
valet open [name] |
Open the site in your browser | |
valet which |
Determine which driver serves the current directory | |
valet secure [domain] |
Secure the domain with a trusted TLS certificate | ✓ |
valet unsecure [domain] |
Serve the domain over HTTP again and remove its certificate | ✓ |
valet secured [site] |
Determine if the site is secured | |
valet domain [domain] |
Get or set the domain used for Valet sites | ✓ (set) |
valet port [port] [--https] |
Get or set the HTTP/HTTPS port | ✓ (set) |
valet proxy <domain> <host> [--secure] |
Create an Nginx proxy site for the given host | ✓ |
valet unproxy <domain> |
Delete an Nginx proxy config | ✓ |
valet proxies |
Display all of the proxy sites |
Per-project Nginx config
| Command | Description | sudo |
|---|---|---|
valet nginx:publish [site] [--force] |
Publish the site's default Nginx config into the project | |
valet nginx [site] |
Activate the project Nginx config | ✓ |
valet nginx:reset [site] |
Restore Valet's default Nginx config | ✓ |
PHP
| Command | Description | sudo |
|---|---|---|
valet use [version] [--update-cli] [--ignore-ext] |
Set the global PHP version (8.2 – 8.5) | ✓ |
valet isolate [phpVersion] [--site=] [--secure] |
Use a specific PHP version (7.0 – 8.5) for a site | ✓ |
valet unisolate [--site=] |
Go back to the global PHP version | ✓ |
valet isolated |
List all sites using isolated PHP versions | |
valet which-php [site] |
Get the PHP executable path for a site | |
valet php [--site=] [command] |
Run PHP with the site's PHP version | |
valet composer [--site=] [command] |
Run Composer with the site's PHP version |
Database
| Command | Description | sudo |
|---|---|---|
valet db:list |
List all databases | |
valet db:create [name] |
Create a database | |
valet db:drop [name] [-y] |
Drop a database | |
valet db:reset [name] [-y] |
Drop and re-create a database | |
valet db:import <name> <file> |
Import a .sql / .sql.gz dump |
|
valet db:export [name] [--sql] |
Export a database (gzipped by default) | |
valet db:configure [--force] |
Configure the database credentials used by Valet |
Sharing
| Command | Description | sudo |
|---|---|---|
valet share |
Generate a publicly accessible URL for the site | |
valet fetch-share-url |
Get the URL of the current ngrok tunnel | |
valet ngrok-auth <token> |
Set the ngrok authentication token |
Editors
| Command | Description |
|---|---|
valet code [folder] |
Open in Visual Studio Code |
valet ps [folder] |
Open in PhpStorm |
valet atom [folder] |
Open in Atom |
valet subl [folder] |
Open in Sublime Text |