Missing SMB,CIFS in nextcloud

Nextcloud version : 21.0.2
Operating system and version: OMV5
Apache or nginx version: v2.9.3
PHP version: 7.3.27-1

The issue you are facing:

I cannot configure an SMB external drive in my nextcloud.
Is SMB not in the image already?
how to make it work?

please can someone help me?

Have you enabled External storage support?

yes the feature is enabled but still it says i have to install it or make to it work

So, did you?
Press the pull-down menu Speicher hinzufugen, chose CIFS/SMB and configure it

Yeah i tried it already. I can pull down the window but the SMB menau is missing

image

Also i tried to download the SMB drivers with
apt install smbclient and apt install smbclient libsmbclient-dev

but no success, the docker still don’t shows the smb setting.

I really don’t what i can do. Before i used nextcloudpi and everything worked fine also SMB but because of nginx i had to switch to normal nextcloud and now i have only trouble…

Sorry, I don’t use docker.
Are you sure this is how it’s installed in docker?

You might want to ping @KarlF12 on this…

The problem is the smbclient packages need to be installed inside the Docker container. Installing it on the Docker host OS won’t work. I don’t know why it isn’t included. It would save a lot of people a lot of trouble if they included the two little packages.

You can open a shell in the container using docker exec, then install with apt. This is only a temporary fix because next time you pull an updated container image, it won’t have smbclient again.

A more permanent fix is to build the container image yourself. Docker-compose can do this mostly automatically once you set it up.

You can find out how to do this here:
https://github.com/docker-library/docs/blob/master/nextcloud/README.md#adding-features

I also cover it briefly in my guide:
https://help.nextcloud.com/t/howto-ubuntu-docker-nextcloud-talk-collabora/76430

No problem, thanks for your help and time :slight_smile:

The problem is the smbclient packages need to be installed inside the Docker container. Installing it on the Docker host OS won’t work. I don’t know why it isn’t included. It would save a lot of people a lot of trouble if they included the two little packages.

You can open a shell in the container using docker exec, then install with apt. This is only a temporary fix because next time you pull an updated container image, it won’t have smbclient again.

A more permanent fix is to build the container image yourself. Docker-compose can do this mostly automatically once you set it up.

You can find out how to do this here:
docs/nextcloud/README.md at master · docker-library/docs · GitHub

I also cover it briefly in my guide:
https://help.nextcloud.com/t/howto-ubuntu-docker-nextcloud-talk-collabora/76430

Ahh…
Yeah makes no sense that thes dont include this in the image already…
Thanks for your time and explanation. Now i am outside but later in evening i will read and try that. I never did build a image myself, but can you tell from experience if it is hard for beginners or not? I mean building a docker container is one thing but an image?..sounds hard :sweat_smile:
I will report back here if it worked or not or if i have problems

If you use docker-compose it’s mostly automatic. I don’t know if your setup is using docker-compose. Basically you’ll download or write a Dockerfile that adds the SMB packages. For example this one here: https://github.com/nextcloud/docker/blob/master/.examples/dockerfiles/smb/apache/Dockerfile

Put it in your folder with docker-compose.xml. Then on your Nextcloud container you’ll comment out this line:

image: nextcloud

And add this under it:

build: .

Then when you run docker-compose up -d it will build it for you. To rebuild it later for an update:

docker-compose pull
docker-compose build --pull

If you need Nextcloud to use a specific version, it’s at the top of the Dockerfile.

If you use docker-compose it’s mostly automatic. I don’t know if your setup is using docker-compose. Basically you’ll download or write a Dockerfile that adds the SMB packages. For example this one here: docker/.examples/dockerfiles/smb/apache/Dockerfile at master · nextcloud/docker · GitHub

Put it in your folder with docker-compose.xml. Then on your Nextcloud container you’ll comment out this line:

image: nextcloud

And add this under it:

build: .

Then when you run docker-compose up -d it will build it for you. To rebuild it later for an update:

docker-compose pull
docker-compose build --pull

If you need Nextcloud to use a specific version, it’s at the top of the Dockerfile.

Sounds not that hard. I use Portainer 2.5.1 so i guess it uses Docker compose, but i also know how to create a docker in the terminal with the

docker-compose.yml

and

sudo docker-compose up -d

I will try that later.


One thing i also don’t understand, when i try to login in my nextcloud then i type in my admin user information and password but it is stuck in login. The circle symbol is running but nothing happens. Only when i refresh the page during login then suddenly i am logged in. :thinking:
This also stps me from login on my nextcloud app on my phone becuause i cannot pass the login becuause i cannot refresh the page.
Weird…do you saw this behavior before?

Also in my overview setting i get this shown up

Something about well known /calddav … whatever
Maybe i am stupid but i totally dont know for what this is for and how to fix this. Even with the documentation i have no idea…

okey i am on building a docker txt file to modify my nextcloud image but what i struggle with is i dont know what i should write in it. If i look at the links you send it says

apache

fpm-alpine

fpm

but what do i choose? I use a raspberry pi 4 with nginx to manage stuff. i dont run a apache.
How i should build the dockerfile then?

At least i know that i have to write this, but after this i am lost

FROM nextcloud

RUN ....

I am sorry for my stupid questions but i am a beginner and never did this before. I feel a little bit overwhelmed with so much options and possibillities i can do…

Then also the build: . part what i have to add in my compose.yml is a bit unclear

But i understood already that with the docker file i can adjust the image and add all the packages i want to it for my nextcloud for additional features. And i have to run special commands to update it.

Okey i tried the Dockerfile stuff now several times but i don’t get it to work…

i used my docker with the docker-compose.yml :

version: '2'

volumes:
  nextcloud:
  db:

services:
  db:
    image: yobasystems/alpine-mariadb:latest
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
    volumes:
      - /var/lib/ncdata2/database2:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD="MyPassword"
      - MYSQL_PASSWORD="MyPassword"
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: build: ./var/lib/ncdata2
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - /var/lib/ncdata2/nextcloud2:/var/www/html
    restart: always

And replaced the “image: nextcloud:latest” with "image: build: . "

My Dockerfile looks like this:

FROM nextcloud:apache

RUN apt-get update && apt-get install -y procps smbclient && rm -rf /var/lib/apt/lists/*

but i always get this error:

ERROR: yaml.scanner.ScannerError: mapping values are not allowed here
  in "./docker-compose.yml", line 21, column 17

I thouht that maybe i forgot a space but in my opinion everything seems fine or not? :man_shrugging:

Maybe you @KarlF12 know something and can tell my stupid mistake :sweat_smile:

1 Like

Remove image:

build: should point to the location of Dockerfile (build instructions). If Dockerfile is in the same folder as docker-compose.xml then just a . dot will suffice.

  app:
    build: .
1 Like

For God’s sake…that was the solution. I am so stupid…nvm

Thank you very very much for helping me. I don’t know if the other setting stuff is still messed up or working now but the smb problem is gone. I can now successfully set a SMB folder to my exernal drives.
Thank you :slightly_smiling_face:

may be late to the party but those who install nextcloud on Truenas you can do following to fix the missing SMB option in External Storage for nextcloud.

  1. Modify your FreeBSD.conf as bellow
    /usr/local/etc/pkg/repos/FreeBSD.conf
    FreeBSD: { enabled: yes}

  2. Make sure what version of php is install in my case if i run following I get PHP 8.2.15
    php -v
    PHP 8.2.15 (cli) (built: Feb 1 2024 01:25:24) (NTS)

  3. Run the following comand to install smbclient packages. Make sure to replace the php version according to yours. In my case it’s 8.2 so I will modify my command as following
    pkg install php82-pecl-smbclient

Proceed with this action? [y/N]: y

  1. Now if you refresh the page on Nextcloud and goto Administrative setting > Administration > External storage. You will see SMB/CIFS in the dropdown menu of External Storage.

  2. Congratulation all fixed. :slightly_smiling_face: