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 CLI
- Docker Compose
./laradock info
Shows what's running, plus the URLs, ports, and passwords to reach each service.
docker compose ps
# Or use Docker directly (all containers, not just this project):
docker ps
Enter a container
Open a shell inside a running container to run commands in it.
- Laradock CLI
- Docker Compose
./laradock enter mysql
docker compose exec mysql bash
Swap mysql for any container name. To open the MySQL prompt directly instead of a shell:
- Laradock CLI
- Docker Compose
./laradock exec mysql mysql -udefault -psecret
docker compose exec mysql mysql -udefault -psecret
Type exit to leave.
./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 CLI
- Docker Compose
./laradock stop
docker compose stop
Stop a single container:
- Laradock CLI
- Docker Compose
./laradock stop mysql
docker compose stop mysql
Delete containers
- Laradock CLI
- Docker Compose
./laradock remove
docker compose down
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 CLI
- Docker Compose
./laradock logs mysql
docker compose logs mysql
Follow the log live with -f:
- Laradock CLI
- Docker Compose
./laradock logs mysql -f
docker compose logs -f mysql
See the Docker Compose logs options for more.
Build or rebuild containers
After editing any Dockerfile, rebuild for the change to take effect:
- Laradock CLI
- Docker Compose
./laradock rebuild
docker compose build
Rebuild a single container instead of all of them:
- Laradock CLI
- Docker Compose
./laradock rebuild mysql
docker compose build mysql
Use --no-cache to force a full, clean rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild --no-cache mysql
docker compose build --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
- Find the image's
Dockerfile, formysqlit'smysql/Dockerfile. - Edit it as you like.
- Rebuild the container:
./laradock rebuild mysql(ordocker 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.