---
title: Troubleshooting a Non-Running Docker Container
description: In this post I'll show you a quick troubleshooting method for identifying and fixing issues in non-running Docker containers.
date: 2020-05-26
tags: Docker, Container, Troubleshooting
source: https://brianchildress.co/blog/troubleshooting-stopped-docker-container
---

# Troubleshooting a Non-Running Docker Container

Sometimes we have Docker containers that just won't run, maybe they run briefly and then unexpectedly quit. If you don't have access to the running container, and the logs provided by `docker logs <container id>` aren't very helpful, try this trick.

Let's say our container has a configuration file that might be the cause of our problem. The Docker CLI provides a way to copy files _into_ and _out of_ stopped containers. The `cp` command makes it easy to copy any file from the stopped Docker container back to your host machine for closer inspection.

What it looks like:

```sh
docker cp my_container:/path/to/config.conf .
```

Review file, scratch head, make updates, upload new version to container

```sh
docker cp config.conf my_container:/path/to/config.conf
```
