Local folder does not exist when setting up a local external storage

Nextcloud version: 28.0.1
Operating system and version: debian 12.4.0
Apache version: 2.4.57
PHP version: 8.2.7

When I try to add a local folder I get the error:

StorageNotAvailableException Local storage path does not exist "/home/nextcloud/"

The aforementioned folder shows up when running “$ ls /home” and I have given the www-data user ownership of the folder.

Steps to replicate it:

  1. Install Nextcloud with portainer 2.16.2 using the template:
version: '2'

volumes:
  nextcloud:
  db:

services:
  db:
    container_name: mariadb
    image: mariadb:10.6
    restart: unless-stopped
    command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    container_name: nextcloud
    image: nextcloud
    restart: unless-stopped
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
  1. Add the External Storage plugin to Nextcloud and add a local directory
  2. Create and change the permissions of the folder using the commands:
$ sudo mkdir -p /directory/here
$ sudo chown -R www-data:www-data /directory/here
$ sudo chmod -R 770 /directory/here

Put this folder/mount inside your app container[1].

[1] Context: This path needs to be mounted within your container (i.e at the Docker level). Nextcloud’s External Storage accesses Local storage from the environment it’s running in (i.e. the container not the host it’s running on).

You could, for example, add /home/nextcloud/ as one of your volumes (albeit as a bind mount), in your template/Compose file, to your app service (container).

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