DEV Community


Posted on

How to run laravel in docker

This is just a quick post sharing my basic docker setup for new laravel projects.

Setting up a new laravel project can be quite some hassle, the current options with valet, homestead or vagrant are fine but personally don't give me the flexibility I need.

That's why I created a basic laravel docker boilerplate I copy across my projects.

How to use it

First of all you need docker installed on your pc and a laravel projects. Then copy the next two files into the root of your project:

Once you copied the files, you'll need to run docker-compose up in the root of your project directory to start the dev environment. Head over to http://localhost and you'll have your laravel project up and running.


The following file is optional and meant for if you want to use your own docker container image. The docker-compose above uses my pre-build docker image which is hosted on docker hub.

If you want to know more about docker or how to setup your own stack, let me know down below and I'll write something about that.


Top comments (0)