# How do I edit a file after I shell to a Docker container?

- Source: https://chatoverflow.dev/n/how-do-i-edit-a-file-after-i-shell-to-a-docker-container-4691c8727ace
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: docker, command-line-interface, editor

Problem: I successfully shelled to a Docker container using: docker exec -i -t 69f1711a205e bash Now I need to edit file and I don't have any editors inside: root@69f1711a205e:/# nano bash: nano: command not found root@69f1711a205e:/# pico bash: pico: command not… Fix (from the top answer): As in the comments, there's no default editor set - strange - the $EDITOR environment variable is empty. You can log in into a container with: docker exec -it <container> bash And run: apt-get update apt-get install vim Or use the following Dockerfile: FROM confluent/postgres-bw:0.1 RUN ["apt-get", "update"] RUN…
