Skip to main content

Managing Containers

The core commands you use every day to start, stop, inspect, and rebuild your stack.

Configuring one specific service? The commands here work on any container, but each service also has its own page with its .env flags, ports, and default credentials:

Not listed? Browse the full catalog of 100+ services.

List running containers

./laradock info

Shows what's running, plus the URLs, ports, and passwords to reach each service.

Enter a container

Open a shell inside a running container to run commands in it.

./laradock enter mysql

Swap mysql for any container name. To open the MySQL prompt directly instead of a shell:

./laradock exec mysql mysql -udefault -psecret

Type exit to leave.

tip

./laradock enter always uses the laradock user in the workspace container, so files it creates are owned by your host user (not root). Need root instead? ./laradock enter workspace --root, or manually: docker compose exec --user=laradock workspace bash.

Stop containers

Stop everything:

./laradock stop

Stop a single container:

./laradock stop mysql

Delete containers

./laradock remove

Your data on disk is untouched either way, it lives under DATA_PATH_HOST, outside the containers (see Data & Volumes). docker compose down additionally tears down the project's network, rarely something you need to think about for local dev.

View logs

NGINX writes its logs to the logs/nginx directory. For any other container, use:

./laradock logs mysql

Follow the log live with -f:

./laradock logs mysql -f

See the Docker Compose logs options for more.

Build or rebuild containers

After editing any Dockerfile, rebuild for the change to take effect:

./laradock rebuild

Rebuild a single container instead of all of them:

./laradock rebuild mysql

Use --no-cache to force a full, clean rebuild:

./laradock rebuild --no-cache mysql

Edit a container's Compose config

Everything about a service lives in its folder: its container definition in <service>/compose.yml and its settings in <service>/defaults.env. For plain value changes (ports, versions, credentials), don't edit files at all, just override the variable in your .env. Edit <service>/compose.yml only for structural changes.

Change the MySQL database name (in mysql/compose.yml):

environment:
MYSQL_DATABASE: laradock
...

Map Redis to a different host port (1111), no file editing needed, just add to your .env:

REDIS_PORT=1111

Edit a Docker image

  1. Find the image's Dockerfile, for mysql it's mysql/Dockerfile.
  2. Edit it as you like.
  3. Rebuild the container: ./laradock rebuild mysql (or docker compose build mysql).

For the common cases, toggling a bundled feature, installing a PHP extension, or adding a system package, see Customizing Images.

Add more services

Chances are the service you want already ships with Laradock, browse the full catalog of 100+ services first. To add a genuinely new one, create a folder for it containing a compose.yml with your container definition (plus a defaults.env for its settings, if any), then register it in the root docker-compose.yml by adding an include entry like the existing ones. You'll want to be familiar with the Docker Compose file syntax.