I cannot test this my self, since I don’t use External Storage, but I did a quick search and found this post, which brought me to the following links:
From the Nextcloud docs:
https://docs.nextcloud.com/server/stable/admin_manual/configuration_files/external_storage/smb.html
Note
For improved reliability and performance, we recommended installing libsmbclient-php, a native PHP module for connecting to SMB servers.
Related discussion on GitHub:
https://github.com/nextcloud/server/issues/6865
Conclussion:
As far as I understand it, you need to install the following packages on your server:
smbclient php-smbclient
Note: The names of the packages are referring to Debian / Ubuntu. If you are using another distribution they may be named differently. If your distribution doesn’t provide a pre-built package of php-smbclinet you can try compile it yourself… GitHub - eduardok/libsmbclient-php: smbclient's extension for PHP