If you are using the official Docker compose file or the modified one from the previous post then it is easy to access the logs.

1. Using Docker logs <container-id>

First from the terminal list all docker containers which are running docker ps. This should give you an output similar to the one in the screenshot below:

The first column shows the container-id which we are interested in here. Next you just need to type docker logs d2c3e6066616 and replace d2c3e6066616 with your own container id.

2. Using Docker exec -it /bin/bash

The other way is to actually access the Docker containers and peak inside for the logs. For example in this case:

docker exec -it docker exec -it d2c3e6066616 /bin/bash/bin/bash

Of course replace d2c3e6066616 with your own container-id again. For the WordPress Docker container the logs should be in /var/log/apache2 and the MySQL container the logs should in /var/log/mysql.

Alternatively you could also mount the whole thing to a host volume.