Docker All in one - Set persistent volume

Hi all,

I deployed the Nextcloud All in one docker image and I managed to get it up and running. Could anyone please tell me how do I set an NFS persistent volume so that all the data are stored outside of the container on an NFS share?

Thank you in advance

Hi, I suppose you are looking for this

or this

Yes, I was reading the first link you sent. I forgot to mentioned that I am using portainer … In Portainer, created an NFS volume and created a new stack where I copied the docker-compose.yml in it. In the stack option, I added an env variable ‘NEXTCLOUD_DATADIR’ but I am not sure what to enter in the value

Should I copy the value from the volume mount point showing in this screenshot?

See

where does the ‘-e’ flag go?
is it in here like this?

sudo docker run \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 80:80 \
--publish 8080:8080 \
--publish 8443:8443 \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
**--e NEXTCLOUD_DATADIR="/var/lib/docker/volumes/Nextcloud_NFS/_data"**
nextcloud/all-in-one:latest

can’t you rename the volume to nextcloud_aio_nextcloud_datadir as recommended? And yes, it would need to go into the docker run command.

yes, I can rename it not problem but I don’t know how to add it to the docker command. What does it look like?
I am new to docker and still at early stage of learning. What is the like I need to add the the run command?

You can try this one:

sudo docker run \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 80:80 \
--publish 8080:8080 \
--publish 8443:8443 \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
-e NEXTCLOUD_DATADIR="nextcloud_aio_nextcloud_datadir" \
nextcloud/all-in-one:latest
1 Like

Yeaaaa!! thank you very much. I managed to get it work. I really appreciate your help and patience :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.