nick_fh_cl
nick_fh_cl

Reputation: 45

How to change the folder where data goes in Docker-compose?

  1. I have a Digitalocean server (debian 11) and I want to host my nextcloud there and also other apps.

  2. For that, I choosed the docker nextcloud way (nginx + let's encrypt).

  3. I noticed I was almost out of disk space. So I added a volume.

  4. Now, I want all my nextcloud data goes there, in that volume.

    trying to do that i've already tried:

    • sudo mkdir /var/lib/docker/volumes/volume_nyc1_01

    • sudo vi /etc/docker/daemon.json

      {
        "graph": "/var/lib/docker/volumes/volume_nyc1_01"
      }
      
  5. sudo docker-compose down and sudo docker-compose up -d

  6. But when i run the command docker info, still get

Docker Root Dir: /var/lib/docker

I will really appreciate it any suggestion or help

Upvotes: 1

Views: 914

Answers (1)

nick_fh_cl
nick_fh_cl

Reputation: 45

This commands were missing

sudo systemctl stop docker
sudo systemctl stop docker.socket
sudo systemctl stop container

after that I could see the root directory has changed

Upvotes: 1

Related Questions