---
title: "How to edit files in stopped/not starting a docker container"  
description: "How to edit files in stopped/not starting a docker container"  
author: "Revati S Misra"  
published: 2023-08-21  
updated: 2023-08-23  
canonical: https://www.mindstick.com/forum/159613/how-to-edit-files-in-stopped-not-starting-a-docker-container  
category: "online file server"  
tags: ["file", "docker container"]  
reading_time: 2 minutes  

---

# How to edit files in stopped/not starting a docker container

How to [edit files](https://www.mindstick.com/forum/159614/how-can-i-edit-files-in-a-docker-container-when-it-s-down-not-started) in stopped/not [starting](https://www.mindstick.com/blog/12024/things-you-need-to-know-when-starting-your-own-business) a [docker](https://www.mindstick.com/forum/161003/what-is-docker) [container](https://www.mindstick.com/forum/159610/how-to-connect-a-windows-container-to-a-service-running-on-localhost)

## Replies

### Reply by Aryan Kumar

There are two ways to edit [files](https://www.mindstick.com/articles/23302/the-importance-and-advantage-of-keeping-your-important-files-on-the-cloud) in a stopped/not starting Docker container:

Use a volume: A volume is a directory that is shared between the host machine and the Docker container. You can use a volume to mount a directory from the host machine to the container. Once you have mounted the directory, you can edit the files in the directory from the host machine.

Use a third-party tool: There are a number of third-party tools that can help you edit files in Docker containers. Some of these tools include:

- Portainer: https://www.portainer.io/: A web-based UI for managing Docker containers.
- Docker Desktop: https://www.docker.com/products/docker-desktop: A desktop application for managing Docker containers.
- Docker Hub: https://hub.docker.com/: A registry for Docker images.

Here are the steps on how to edit files in a stopped/not starting Docker container using a volume:

1. Find the container ID of the container you want to edit the files in.
2. Mount a volume to the container.
3. Edit the files in the volume from the host machine.

Here is an example of how to mount a volume to a container:

```plaintext
docker run -it -v /host/path:/container/path mycontainer
```

In this example, the volume `/host/path` is mounted to the directory `/container/path` in the container.

Once you have mounted the volume, you can edit the files in the volume from the host machine.

Here is an example of how to edit a file in a volume:

```plaintext
nano /host/path/myfile.txt
```

In this example, the file `myfile.txt` is edited in the directory `/host/path` on the host machine.


---

Original Source: https://www.mindstick.com/forum/159613/how-to-edit-files-in-stopped-not-starting-a-docker-container

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
