Installation of nextcloud 18.0.3 in Docker mode, the SMB / CIFS option does not appear in the External Storage option

Hi everything OK?

I installed Nextcloud 18.0.3, in Docker mode, on Ubuntu Arm64. On a Raspberry Pi 4 computer.

The problem is that the option External Storage does not appear the option “smb / cifs”: See message below:

“” smbclient “is not installed. Mounting of” SMB / CIFS “,” SMB / CIFS using OC login “is not possible. Please ask your system administrator to install it.”

Despite having installed the necessary SWs. See below:

"
ubuntu @ ubuntu: / $ sudo dpkg --list | grep ‘samba \ | smb’
ii libsmbclient: arm64 2: 4.7.6 + dfsg ~ ubuntu-0ubuntu2.15 arm64 shared library for communication with SMB / CIFS servers
ii php-smbclient 0.8.0-3build2 arm64 PHP wrapper for libsmbclient
ii python-samba 2: 4.7.6 + dfsg ~ ubuntu-0ubuntu2.15 arm64 Python bindings for Samba
ii samba 2: 4.7.6 + dfsg ~ ubuntu-0ubuntu2.15 arm64 SMB / CIFS file, print, and login server for Unix
ii samba-common 2: 4.7.6 + dfsg ~ ubuntu-0ubuntu2.15 all common files used by both the Samba server and client
ii samba-common-bin 2: 4.7.6 + dfsg ~ ubuntu-0ubuntu2.15 arm64 Samba common files used by both the server and the client
ii samba-dsdb-modules 2: 4.7.6 + dfsg ~ ubuntu-0ubuntu2.15 arm64 Samba Directory Services Database
ii samba-libs: arm64 2: 4.7.6 + dfsg ~ ubuntu-0ubuntu2.15 arm64 Samba core libraries
ii samba-vfs-modules 2: 4.7.6 + dfsg ~ ubuntu-0ubuntu2.15 arm64 Samba Virtual FileSystem plugins
ii smbclient 2: 4.7.6 + dfsg ~ ubuntu-0ubuntu2.15 arm64 command-line SMB / CIFS clients for Unix
"
"
ubuntu@ubuntu:/$ sudo dpkg --list|grep ‘cifs’
ii cifs-utils 2:6.8-1 arm64 Common Internet File System utilities
"

Any idea?

Thanks in advance for your help.

Do you run this command inside the container or on your host? Asking because of the “strange” prompt.

On The Host.

Thanks.

Any idea?

Thanks in advance for your help.

which image are you using?

I don’t know if I understood your question well, but I installed nextcloud via docker-compose together with mariadb.

Software installed on the host not visible by the container?

Thanks.

in time.

Something strange about the “dpkg —list” command output. See: “php-smbclient 0.8.0-3build2 arm64 PHP wrapper for libsmbclient”.

It seems to me that it is not installed properly. Note that the output does not show the string “+ dfsg ~”.

Thanks.

yes. that’s the way it work’s. the container containes just what is needed to run the “application” (e.g. nextcloud, mariadb, nginx).

the docker file defines the content of the image. the image is pulled from a registry by the docker-compose file and started as a container.

in your docker-compose file is a line like image: nextcloud:latest

that leads to the following docker file

in line 45 starts the installation of the smb/cifs php modules.

three ways to add these module:

  • you log into the container and run an docker-php-ext-install -j .... that work’s till you update the the container with a new image. e.g. 18.0.4. then you have to rerun this command.
  • you clone the nextcloud-docker git repo, add the module to line 55, and build the image locally on your server.
    in this case you have to track the git repo for updates as well.
  • or you write your own docker file starting with “FROM nextcloud:latest” and “RUN docker-php-ext-install -j …”. that would always take the latest image and add the needed php modules.

or you open an issue that nextcloud will add this module already to there image. but as far as i remember that was already discussed here in this forum.

or you look for another image wher someone did this job already. you may look at nextcloudpi from ownyourbits.

I’m finding it all a bit complicated.

Was this due to problems with the installation of Nextcloud or the software that was installed during the installation of the containers?

I can start all over again. I am currently installing in a testing environment.

So, what do I need to install BEFORE installing Nextcloud and Mariadb so that installing these containers? Samba, php-smbclient etc

Thanks again for the help.

Below is my YML file. Any suggestions for changes?
"
version: ‘2’
volumes:
nextcloud:
db:
services:
db:
image: mariadb
command: --transaction-isolation = READ-COMMITTED --binlog-format = ROW
restart: always
volumes:
- / media / data / mariadb: / var / lib / mysql
environment:
- MYSQL_ROOT_PASSWORD = xxxxxxxx
- MYSQL_PASSWORD = xxxxxxxx
- MYSQL_DATABASE = DBnextcloud
- MYSQL_USER = nextcloud
app:
image: nextcloud
ports:
- 8080: 80
links:
- db
volumes:
- / media / data / nextcloud: / var / www / html
- / media / data / nextcloud / apps: / var / www / html / custom_apps
- / media / data / nextcloud / config: / var / www / html / config
- / media / data / nextcloud / data: / var / www / html / data
- / media / data / nextcloud / themes: / var / www / html / themes
environment:
- NEXTCLOUD_TRUSTED_DOMAINS = 192.168.1.250
restart: always
"

indeed it is.

first use ``` to quote yaml files. better readable.

we start here:

you have to download the content of this folder https://github.com/nextcloud/docker/tree/master/18.0/apache and change your docker-compose file to

app:
  build: .

before you run docker-compose up -d you have to edit the Dockerfile and add around line 58 the installation of the smb/cifs php module. i don’t know docker-php-ext-install so I can’t tell you what to add.

maybe you’ll find some advice here:

how to update?

when a new version is release you have to edit the Dockerfile and rerun docker-compose run -d

of course you have to check if the Dockerfile and the other files in that folder are changed.

If you have a look at the Nextcloud Docker documentation under Adding Features they have an example and Dockerfile showing how to rebuild the Nextcloud image with SMB support.

Since no one is helping in my threads I was thinking to ask here, I have the same issue of not being able to add SMB support to my docker nextcloud and after following the instructions in the repo about the Dockerfile and build: . it just doesn’t work on Ubuntu 20.04.

Building nextcloud
Traceback (most recent call last):
File “bin/docker-compose”, line 3, in
File “compose/cli/main.py”, line 67, in main
File “compose/cli/main.py”, line 126, in perform_command
File “compose/cli/main.py”, line 302, in build
File “compose/project.py”, line 468, in build
File “compose/project.py”, line 450, in build_service
File “compose/service.py”, line 1125, in build
File “docker/api/build.py”, line 160, in build
File “docker/utils/build.py”, line 30, in tar
File “docker/utils/build.py”, line 49, in exclude_paths
File “docker/utils/build.py”, line 214, in rec_walk
File “docker/utils/build.py”, line 214, in rec_walk
File “docker/utils/build.py”, line 184, in rec_walk
PermissionError: [Errno 13] Permission denied: ‘/home/ex/nextcloud/mariadb/mysql’
[9839] Failed to execute script docker-compose

It looks like your guide correctly implements the Persistent Data section, just wondering if you were able to get SMB support correctly implemented using the official instructions? Because it’s been many months and no one seems to have the same problem as me

@smb_apache Yes, it does work. You can use one of the official Dockerfiles as-is to build it with SMB support.

You can also open bash in the container and simply install the smb packages, with the understanding that change will be lost when you update.

This is interesting because building the Nextcloud image (to my understanding) would have no need or reason to access the persistent storage of another container (mariadb). So it seems like you have some other issue.

Maybe you could provide some more context? Such as your configuration?

Yes if there’s anything wrong with my docker-compose I’d like to know, here it is (I took out Collabora and Coturn as I don’t use those):

version: '3.7'

networks:
 nextcloud:

services:
  nextcloud:
    image: nextcloud:custom
    build: .
    container_name: nextcloud
    networks:
      - nextcloud
    ports:
      - "127.0.0.1:8080:80"
    volumes:
      - ${NEXTCLOUD_ROOT}/html:/var/www/html
      - ${NEXTCLOUD_ROOT}/data:/srv/nextcloud/data
    extra_hosts:
      - "${NEXTCLOUD_FQDN}:${NEXTCLOUD_IPADDRESS}"
      - "${COLLABORA_FQDN}:${NEXTCLOUD_IPADDRESS}"
    depends_on:
      - mariadb
      - redis
    environment:
      - NEXTCLOUD_TRUSTED_DOMAINS='${NEXTCLOUD_FQDN}'
      - NEXTCLOUD_DATA_DIR=/srv/nextcloud/data
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=blank
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_HOST=nextcloud-mariadb
      - REDIS_HOST=nextcloud-redis
    restart: unless-stopped

  mariadb:
    image: mariadb
    container_name: nextcloud-mariadb
    restart: unless-stopped
    volumes:
      - ${NEXTCLOUD_ROOT}/mariadb:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=blank
    networks:
      - nextcloud

  redis:
    image: redis
    container_name: nextcloud-redis
    networks:
      - nextcloud
    restart: unless-stopped

I don’t think anything in your compose file is the issue. Have you altered the ownership or permissions of any of these files?

@smb_apache this is caused by your Dockerfile rather than the docker-compose file. or?

could you post your Dockerfile?

@KarlF12 @Reiner_Nippes
I have not altered ownership or permissions of any files except for the chown www-data step from Karl’s original guide. The dockerfile I used is exactly what is found here: docker/Dockerfile at master · nextcloud/docker · GitHub