Video Lesson: Start, stop, restart, and check container status in Docker

Start, stop, restart, and check container status in Docker

Learn how to manage containerized services by starting, stopping, restarting, and checking their status.


Lesson Content

The most basic helper scripts in docker-magento are bin/start, bin/stop, and bin/restart.

To start the project, run:

bin/start

This command runs automatically after you set up Magento. You need to run it again whenever you restart your host machine or restart the Docker daemon. It starts all the services defined in the docker-magento YAML files.

To stop the project, run:

bin/stop

This stops all the containers and services. You need to run bin/stop before starting another docker-magento project.

You can install as many docker-magento projects on one machine as you want, but only one project can run at a time. Stop the current project before starting another one.

The bin/restart script stops the containers and starts them again:

bin/restart

This is equivalent to running bin/stop followed by bin/start. Use it after changing an INI or other configuration file when the services need to restart before the changes take effect.

Finally, use bin/status to check the status of all the services:

bin/status

Look at the STATUS column to see whether each service is running. A running service has a status such as Up. If you stop the containers and run the command again, their status is exited:

bin/stop
bin/status

This gives you a quick way to check whether all the services are running and to identify a specific service that failed to start.

Maggie

Hey, I'm Maggie! 👋

Ask me anything.

Want to chat with Maggie?

Log in for AI tutor access.

Comments

Join the discussion!

Notes

Keep track of what you learn!