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

stratboy's avatar

What environment for development?

Hi you all! This is the 3rd time I try to study Laravel, in the last few years :) I like it very much but I never end up with something, due to new projects coming in an taking me away from studying... Anyway: the first time I tried to study Laravel, I used Homestead for local development. Then I found out the sweet, sweet Valet, I remember I absolutely loved it!

Now I've just read updated docs, and guess what? It seems the recommended way is using Docker.

So my real question is: why now Docker? And.. Should I really use it or just stick on Valet for my first steps? Is it Valet somewhat 'deprecated'? (even if I still can see it in documented Packages docs).

Thank you!

0 likes
8 replies
martinbean's avatar

@stratboy Docker’s a popular choice because it puts everything you need in containers that can start and stop at will, or even destroy and re-create in a predictable fashion. Valet on the other hand, yes, it gives you a web server, but anything else your application needs (a database, a Redis cache, a mail server, Mailhog, Min.io, and so on) you need to install on your machine.

If you’re installing them on your machine, you can only have one version of each installed at one time. With something like Docker, you can have containers with different versions of things. So for example, if you’re working on one project that needs PHP 7.4 and another than needs 8.0, you can have those version defined in your Docker environment. If you’re relying on the PHP version installed on your machine, well, good luck. You’re going to constantly having to swap versions using something like Homebrew if on macOS.

So ion short, Valet is just a glorified web server running on your machine. Docker is an actual development environment.

2 likes
Nakov's avatar

Valet is not deprecated and I still use it.

The benefits of using Docker is that you are not tight to installing every single service directly on your machine, but you keep it in a Docker container, that means you can create as many as you want and have different services, PHP versions and so on on each container, while it is a bit harder to maintain that on your local machine. Laravel has Sail which helps with the Docker setup if you are up for that.

--EDIT Just saw that Martin gave a very good answer as well, but I'll keep mine here too :)

1 like
stratboy's avatar

Thank you very much to both! Wow... :)

jlrdw's avatar

You can also install the zip versions of mariadb, nginx, and php. And have a couple of folders one for one version, etc. This way you can work without a container.

I can't see having a need for more that two versions of php. Just me, but I don't like containers or VM's.

Just example of a folder structure"

wnmp
----mariadb
----nginx
----php

That one is php 8.1. I have another folder with all the same except a earlier version of php. Never had a problem.

Of course a simple batch file to start and stop as needed.

1 like
stratboy's avatar

I'm not so good in configurations, so I'm a bit afraid of what you call 'zip versions' and install them and use a 'batch file'... :)

Aaannnnnd... why not just use mamp pro? I can't get the difference between it, which always works, and Docker... Both let you have several 'servers' with different configurations and technologies. Maybe Docker is more powerfull, but since here we just need php, mariadb and apache or nginx... mamp pro have them all, with swichable versions, and is not that bad, at least with normal wordpress sites, for example. Any weakness?

martinbean's avatar

why not just use mamp pro? I can't get the difference between it, which always works, and Docker... Both let you have several 'servers' with different configurations and technologies. Maybe Docker is more powerfull, but since here we just need php, mariadb and apache or nginx... mamp pro have them all, with swichable versions, and is not that bad, at least with normal wordpress sites, for example. Any weakness?

@stratboy It still requires all that software to be installable on your machine. Docker is container-based. Those things (PHP versions, MariaDB, Apache, nginx, etc) will have “images” that can be pulled down, updated, destroyed without having to install anything on your computer. You can move to a completely new computer, install Docker, and build your set-up again from scratch without having to manually install PHP or MariaDB or anything else.

Please or to participate in this conversation.