A Minimalist Development Environment for WordPress with Laravel Valet

Yesterday, Taylor Otwell released Laravel Valeta development environment for Mac minimalists. It didn’t take long before Taylor also released a driver for WordPress, which is why I thought I’d do a write-up here on the blog.


Valet is a super simple approach to development environments. I use Vagrant every day and I love it. It’s just that sometimes… Sometimes you just need something simple that just works! Well, Valet is that. If you are just curious to know more about Valet, jump to the bottom of this post, where I go over a few general questions. Feel free to add any additional questions you might have in the comments.

Note: Valet is Mac only. If you are looking for a super simple cross-platform alternative, check out Wocker.

Before we get started, you can also check out Adam Wathan‘s awesome ad spot for Valet:


Installing Laravel Valet is very straight forward, given you have a few things already set up on your Mac. I’m not going to go over the process here, because Taylor already wrote some great documentation for you.

The 2 main things you need in order to install Valet are Homebrew and Composer. I couldn’t get it to work with my current version of Homebrew, so I scrapped it and reinstalled it. After that everything worked like a charm. You are going to use Homebrew to install PHP 7 before you install Valet. As for the database, I followed Taylor’s recommendation and installed MariaDB (a better alternative to MySQL) with Homebrew as well.

Setting up a WordPress site

Valet has a WordPress driver (you can create your own drivers if you need something else), so out of the box, it supports running WordPress sites. It’s actually smart enough to figure out which driver to use, so there’s zero configuration needed, other than the usual WordPress stuff.

There are 2 ways Valet can serve your sites: The park or the link option. The park option can be used to add a whole folder to Valet. Every folder in there will then be mapped to a site and get it’s own .dev domain. So if you add ~/Sites to Valet and there have a folder in there named wp-valet, the content of that folder will be served when you visit http://wp-valet.dev in your browser. No setup required! The link option can be used to serve a single site, without adding a whole directory.

Here’s how I used the park command to add a folder to Valet:

$ mkdir ~/Sites
$ cd ~/Sites
$ valet park

That’s literally it. Then I went ahead and used WP-CLI to install WordPress:

$ mkdir wp-valet
$ cd wp-valet
$ wp core download

I then jumped over in Chrome and visited http://wp-valet.dev and that’s it! Super simple.

WordPress Laravel Valet

Sharing your site (this is cool)

Valet can do something that’s pretty cool, by using ngrok. Imagine that you’re working on something locally that you need to quickly show someone. What do you do? Set up a staging site just for that? On a subdomain? On another domain? Just a screenshot maybe? Well, if you’re using Valet, you can just type valet share in your Terminal app and Valet will setup a secure tunnel to your localhost and give you a link to share! Pretty cool stuff.

When you’re done sharing, you just hit Ctrl-C and the tunnel will be closed again.

A few more things

Here are a few answers to some questions you might be having. Please ask questions in the comments and I’ll add them here as well!

Does Valet mess with my hosts file?

Nope. It uses dnsmasq to capture all requests to .dev domains (unless you have an entry for them in your hosts file).

Which server is Valet running on?

Valet is using the built-in server in PHP, which was introduced in PHP 5.4. Valet runs on PHP 7.

When should I use Valet and not Vagrant?

I personally use Vagrant for larger projects, where I have a lot of dependencies, such as older versions of PHP, and like to work in an isolated environment. What I intend to use Valet for is those quick and dirty things, where you just need something to run right now. I don’t like installing to much stuff on my Mac, so if that’s required, I’d rather work in a Vagrant box.

Have more questions? Just post a comment below and I’ll add it here!

I hope you found this post useful! Now, go check out Valet.

WP Pusher – Git for WordPress

This post was brought to you by WP Pusher.

WP Pusher keeps all your client websites up-to-date whenever you push a change to GitHub or Bitbucket. Visit our website to learn more about WP Pusher.



Want to read more like this?

Add your email address below to stay in the loop when new content arrives. You'll never miss a post.

Peter Suhm

Peter is a web developer from the Land of the Danes. He is the creator of WP Pusher and a huge travel addict.


34 thoughts on “A Minimalist Development Environment for WordPress with Laravel Valet

  1. This is great, Out of curiosity, for those of us that do have .dev in our hosts file (thanks to desktop server etc), is there a way for it to use something other than .dev?

  2. This is pretty awesome thanks for sharing this. I wasn’t initially able to get `valet install` to work, but then I did `export PATH=”~/.composer/vendor/bin:$PATH”` and it was able to run just fine.

  3. This is very cool and amazingly quick, although it’s not seeing the DB (I installed MariaDB and am using root, blank, localhost.

  4. Laravel Valet seems great, but am having some trouble getting it up and running. Must I have Laravel installed somehow? Terminal does not recognize “laravel” commands. Also, how do you know the credentials and database name for mariadb database?

    1. You have to make a database. You can use homebrew to install phpmyadmin. I used Sequel Pro to connect to the database server and made a database there.

      In Sequel Pro I used “” as the host and “root” as the username, with no password to connect.

      Also, no need to use “laravel” commands. You should be able to use “valet” to make that work, I had to modify ~/.bash_profile and add:

      export PATH=”$PATH:$HOME/.composer/vendor/bin”
      export PATH=”/usr/local/sbin:$PATH”

  5. I get all the way through the install steps. When I try to run valet install, I just get ‘command not found’. Everything else seemed to go OK. Any ideas?

    1. Please add this to you .bash_profile export PATH=”~/.composer/vendor/bin:$PATH” like Josh explained.

      1. OK, it seems that, because I’m using the Fish shell, some entries in the .bash_profile were causing issues and I couldn’t add the path to composer. I returned to using Bash and now all is well.

    2. As a temp fix, you can also run `~/.composer/vendor/bin/valet install`, if it’s not added to your PATH.

  6. This works really well. The one thing it’s failing for me is the command “valet logs” which always says “No log files were found”

  7. Is anyone else having trouble with only getting 404 – Not Found pages? That’s all I get, no matter what I do.

  8. This is looking great, pretty simply to setup and very fast. A few days ago I am sure I read a post/comment that included some php to rewrite wordpress URLs so they dont contain index.php, for the life I me I cant find it. Was I dreaming ?

  9. Anyone an idea? Login into wordpress with mysite.dev/wp-admin (without trailing slash) gets me broken admin links. The permalinks contain ‘index.php’. Valet is ‘on-latest-version’. Thanks in advance.

      1. Well, at least I always provide the trailing slash or use wp-login.php. It’s just the dev environment so it doesn’t really bother me. You can get rid of ‘index.php’ by rewriting the permalinks. It’s not a problem specific to valet. Have faced the same problems with some Mamp installs.

    1. I had this same issue. You can run ‘brew install dnsmasq’ separately then try ‘valet install’ again and it’ll work fine 🙂

  10. How did you get the database connected? I’ve got everything installed, but WordPress obviously needs to be set up. How could you possible download the core and automatically have everything installed in the database already?

Leave a Reply

Your email address will not be published. Required fields are marked *