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

Sinnbeck's avatar
Level 102

Laravel Served - New laravel package for setting up a development environment (docker)

I am currently working on a new package for laravel called Served. It is meant to make it very easy for people to start a development environment using laravel (like php artisan serve. It uses a laravel config file to manage your services, meaning it should be easy to set up and use.

The package requires

  • Php (cli)
  • Docker
  • Laravel

It has been tested on ubuntu, and windows (xampp). I don't own a Mac, but feel free to give it a try as I assume that it will work there as well.

In theory you can just install it and run php artisan served:up to get everything you need (php 7.4, Nginx 1.9.2, and mysql 5.7) to start working

Be aware that this is still a beta package, and I am just hoping to get some feedback

https://packagist.org/packages/sinnbeck/laravel-served

0 likes
14 replies
Sinnbeck's avatar
Level 102

Yeah homestead or just php artisan serve

If I quickly want to work on a new project, I find it takes some time to get it up and running (often I use different versions of php and mysql). This just let's me spin up an environment in a couple of minutes

The idea is to kinda mimic docker compose, but without the user having to know docker setup

automica's avatar

@sinnbeck sweet. i'm mostly using homestead as it means I can ignore local php MySQL versions, and whilst its a bit of a spin up time, it serves its purpose.

your package, using docker, should be nicer as I wont be full up of VMs. will check it out. I'm Mac based so can give you some feedback if you want any.

Sinnbeck's avatar
Level 102

That would be awesome

composer create-project laravel/laravel --prefer-dist blog

cd blog

composer require sinnbeck/laravel-served --dev

//add this to env 
SERVED_NAME=some_name

//change database 
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=laravel
DB_PASSWORD=password

php artisan served:up
Snapey's avatar

How does it compare to Takeout ?

Sinnbeck's avatar
Level 102

It is very much inspired by takeout but as I don't own a Mac I haven't been able to test it out yet (I know they are getting it to work with Linux now).

Thet solve the same issue but in different ways.

Takeaway runs anywhere using a global composer executable. So you make mysql (etc) globally that you use across projects

Served is set up using a config file inside of laravel and is bound to that project. It also supplies both a webserver and php inside of docker, meaning you full environment is running docker.

Sinnbeck's avatar
Level 102

Ah yes sorry. You will actually need to have docker installed :)

automica's avatar

@sinnbeck I thought I did, but turns out I didn't on this Mac (one of 3 on the network).

with that small technicality out of the way, I'm pleased to report that served installed and works as you intended.

The only thing of note on the installer was the following message:

ERROR : docker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:3306: bind: address already in use.

I assume due to some homestead instances being up at the same time?

Sinnbeck's avatar
Level 102

Ah yes. Might end up changing that default. Publish the config, and change it to another port. Then run the served:up command again

Run this to publish

php artisan vendor:publish --provider="Sinnbeck\LaravelServed\ServedServiceProvider"
1 like
Sinnbeck's avatar
Level 102

And to migrate etc you can enter the php container with

php artisan served:ssh
automica's avatar
automica
Best Answer
Level 54

@sinnbeck installed and working. very nice. how is it for memory usage and what would be the approach of getting x-debug enabled in the php.ini?

Happy to carry this on over at the package page (you'll see me as iammikek on GitHub)

Sinnbeck's avatar
Level 102

@automica I am running Ubuntu so mine is probably alot different than yours. And xdebug is enabled by default. Port 9001 (avoiding 9000 as fpm runs on that port). Check the config.

I use it myself with phpstorm using remote debugger config

Please or to participate in this conversation.