Nextcloud on Docker Desktop with Mounted drives

I am trying to create a Docker Compose file for Docker Desktop on Windows with WSL2. I am deploying the compose file with the Portainer extension. I would like to be able to access the storage from my windows instance so I can use some of my utilities for offsite backup. My Compose file looks like it works until I run the setup portion of it and then it gives me an error. Here is a copy of my compose file.

version: "3"

services:
  nextcloud:
    image: linuxserver/nextcloud:latest
    container_name: nextcloud
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Boise
    volumes:
      - config:/config
      - data:/data
    ports:
      - 443:443
    restart: unless-stopped
    networks:
      - network

  nextcloud-db:
    container_name: nextcloud-db
    image: mysql:8
    restart: on-failure
    volumes:
      - mysql_data:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=securepassord
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_PASSWORD=securepassword
    networks:
      - network

networks:
  network:
    driver: bridge

volumes:
  config: # Named volume for Nextcloud configuration files.
    driver: local # Managed by Docker's local volume driver.
    driver_opts: # Command to bind the Windows folder to the Linux server
      type: none
      o: bind
      device: "/host_mnt/c/NextCloud/Config"
  data: # Named volume for Nextcloud user data.
    driver: local # Managed by Docker's local volume driver.
    driver_opts: # Command to bind the Windows folder to the Linux server
      type: none
      o: bind
      device: "/host_mnt/c/NextCloud/Data"
  mysql_data:
    driver: local # Managed by Docker's local volume driver.
    driver_opts: # Command to bind the Windows folder to the Linux server
      type: none
      o: bind
      device: "/host_mnt/c/NextCloud/MySQL_Data"

The thing that seemed strange (but may be correct) is the volumes in the volume list are listed like nextcloud_config and not just config but I don’t know if that makes a difference or not. After I deploy the stack it looks like files go in the folders but not all the data ends up in there. Any ideas that I can try?

hi @philipt welcome to the forum :handshake:

you are using custom linuxserverio image - I would recommend you consult linuxserver.io Nextcloud docs and reach out to linuxserver.io Support

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