Report this

What is the reason for this report?

How do I give correct permissions to shared volumes in Docker?

Posted on December 7, 2020

I followed this guide https://www.digitalocean.com/community/tutorials/how-to-share-data-between-docker-containers and created a volume that I share between my samba and nextcloud containers. However, samba and nextcloud are accessing it from different usernames, and I can’t find a way to make them both have read/write access to it. I’ve tried to create a group (on the host, where the volume is located) and put both www-data and the samba user in that group and give that group write permission on the volume. But somehow only the user who is chown the volume can read, even if it’s also chown to the group. Any suggestions on this?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there @2panomitrius,

Do you have write permissions for the group as well?

What I could suggest is also taking a look at this tutorial here on how to share data between containers with volumes:

https://www.digitalocean.com/community/tutorials/how-to-share-data-between-docker-containers

Regards, Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.