MAMP to Valet
One-time Dependency Setup/Configuration
wget https://getcomposer.org/download/1.1.0/composer.phar && chmod +x composer.phar && sudo mv /usr/local/bin/composer && composer self-update
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update just to be sure everything is up to date.
wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && chmod +x wp-cli.phar && sudo mv /usr/local/bin/wp
Install Laravel Valet globally
composer global require laravel/valet
Ensure Composer global bin is in your
which valet >/dev/null 2>&1 || echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"' >> "$HOME/.bash_profile"
Restart your terminal or
This also assumes you are using Terminal/iTerm. If you are using a different shell, eg: zsh, you should know how to update your
Settings > General Tab:
- UNCHECK: Start Apache and MySQL on system startup
- UNCHECK: Start Apache and MySQL when opening MAMP PRO
- CLICK: Set default MAMP ports
MAMP is now running on the default non-standard ports so it won't be conflicting with our new local services. You can continue to use it to host your databases if you want (instead of Homebrew installed MariaDB or MySQL), but it would require more effort than to switch over.
Export all the things!
Export All Databases from MAMP (optional)
mysqldump -u root -p --all-databases > ~/mysql-all-databases.sql
-pyourRootPasswordYesThereIsNoSpaceThere (leave as-is for blank password)
This will export all databases to a file named
mysql-all-databases.sql in your user's home directory.
Run this to ensure its available
Start up MariaDB
brew services mariadb start
mysqlcommands should now be targeting mariadb instead of MAMP's mysql. New credentials are: username
root, password `` (empty). To check this, run
which mysqlIt should now be `/usr/local/bin/mysql`
Import all databases
mysql -u root -p < ~/mysql-all-databases.sql
Run Valet setup
Congratulations, Valet is ready to go!
Let's try it out...
From the terminal, navigate to the directory which holds your projects/websites. (Easy way - drag the folder from Finder onto the Terminal icon - a new terminal window will open for that directory)
It should say "The ____ directory has been added to your paths"
Now, if your project directory has a folder in called "example", you can now open your browser and go to
http://example.dev and it should magically work!
Until now, the instructions have been totally framework agnostic, as Valet supports many.
Using Valet with WordPress
Note: the previous
wp-config.phpwill likely need to be updated for the new database. Make sure you update these to reflect the proper
DB_PASSWORD-> `` (empty string).
Creating New Sites in a Single Command
One last thing to install...
wp package install aaemnnosttv/wp-cli-valet-command
Meet your new single command workflow
From that same directory, or any other directory you have "parked", run:
wp valet new my-project
Congratulations, you now have a fresh new install of WordPress in the
my-project directory, available RIGHT NOW in your browser at https://my-project.dev