# Can't install vim in Docker container

**URL:** <https://community.kinsta.com/t/cant-install-vim-in-docker-container/1525>\
**Category:** Installation\
**Created:** [June 1, 2022, 1:23am UTC](https://community.kinsta.com/t/cant-install-vim-in-docker-container/1525 "2022-06-01T01:23:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![infoarts](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/infoarts/32/1187_2.png) [@infoarts](https://community.kinsta.com/u/infoarts)\
**Post date:** [June 1, 2022, 1:23am UTC](https://community.kinsta.com/t/cant-install-vim-in-docker-container/1525/1 "2022-06-01T01:23:05Z")

</div>

I’m trying to install vim in a Docker container via `apt update` and `apt-get install vim` but the first command fails with a permission denied error.

I’m guessing I need to run these commands as root but am not sure how to do so. Any clues appreciated.

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/kevin/32/808_2.png) [@Kevin](https://community.kinsta.com/u/Kevin)\
**Post date:** [June 1, 2022, 4:06pm UTC](https://community.kinsta.com/t/cant-install-vim-in-docker-container/1525/2 "2022-06-01T16:06:45Z")

</div>

Hi @infoarts, welcome to DevKinsta!  
Which container are you trying to install vim on? For example this works on the `devkinsta_nginx container` :

1. `docker exec -it devkinsta_nginx /bin/sh`
2. `apk update`
3. `apk add vim`

If the container has bash installed, you can add `-u root` to your exec command which might solve your permissions issue:

`docker exec -u root -it devkinsta_fpm bash`
