|Tags||cloud, files, dropbox, seafile, pydio, ajaxplorer, owncloud|
Nextcloud is a suite of client-server software for creating and using file hosting services. It is functionally similar to Dropbox, although Nextcloud is free and open-source, allowing anyone to install and operate it on a private server.
As per SME Server Keep It Simple, all your ibays and home folders will be accessible through the nextcloud interface using the "external files" app. You will also have your main user user Nextcloud folder saved under /home/e-smith/files/owncloud/data which is in the default backup path. So you can now enjoy both your own cloud repository with access to the very same files on your samba share!
How do I add my SME users ? They are already there ! Just tell them to connect to https://mydomain/nextcloud. You can also add external users or allow them to register with a nextcloud app.
What are the admin ? By default you have a nextcloudadmin user and the regular SME admin user. First one use the password you can see with "config getprop nextcloud AdminPassword", and second one, well, just use your regular admin password. Then you can manage apps, external files repos and admin group membership.
yum install smeserver-nextcloud --enablerepo=smecontribs
you might need a second event or sometime ibays folder is not visible
You do not need to follow the Repo pages of fws and remi-safe to install those two needed repos, instead use the packages to install them followed by a yum-modify event. Then run the main installation.
yum install smeserver-extrarepositories-remi-safe smeserver-extrarepositories-fws smeserver-extrarepositories-epel signal-event yum-modify yum install smeserver-nextcloud --enablerepo=smecontribs,epel,fws signal-event webapps-update service php-fpm start service php71-php-fpm start service php72-php-fpm start service php73-php-fpm start signal-event nextcloud-update
you can skip the service php-fpm* commands if it was already installed and running before the installation of nextcloud
then you can do the following and you can safely ignore the signal-event post-upgrade reboot if prompted, unless you also installed other packages that needs to do so.
config set UnsavedChanges no
signal-event post-upgrade signal-event reboot
if you want to add SME user admin as administrator of nextcloud do
OCC group:adduser admin admin
you might want to set your default phone region (use your country 2 letter code - low case)
occ config:system:set default_phone_region --value="us"
you might want to have nextcloud accessible to the Internet
config setprop nextcloud access public signal-event nextcloud-update
Use a dedicated domain to connect to Nextcloud
first change the first line variable content with you nextcloud domain as defined with your DNS provider.
NEXTCLOUDDOMAIN="cloud.mydomain.com" db domains set $NEXTCLOUDDOMAIN domain Description "Nextcloud" Content Primary Nameservers internet TemplatePath WebAppVirtualHost DocumentRoot /usr/share/nextcloud RequireSSL enabled letsencryptSSLcert enabled signal-event domain-create $NEXTCLOUDDOMAIN # this one to let nextcloud DAV be redirect correctly and to have collabora recognize the domain config setprop nextcloud VirtualHost $NEXTCLOUDDOMAIN signal-event nextcloud-update # only if you use a Let's Encrypt certificate expand-template /etc/dehydrated/domains.txt dehydrated -c
|AdminPassword||GENERATED||string||password for your main admin user for nextcloud (*)|
|AdminUser||nextcloudadmin||string||main admin user for your installation (*)|
|DbName||nextcloud||string||for mysql db|
|DbPassword||GENERATED||string||for mysql db|
|DbUser||nextcloud||string||for mysql db|
|TrustedDomains||empty||strings coma separated||add domain or ip that are in need to be added to default access to nextcloud|
|VirtualHost||empty||domain name||domain dedicated to nextcloud, needs to also be defined as domain on the server|
|MaxUploadSize||4096M||number||if a number will be converted to Megabytes, otherwise use the usual suffix : 2T for 2 terrabytes etc...|
|MemoryLimit||528M||number||if a number will be converted to Megabytes, otherwise use the usual suffix : 2T for 2 terrabytes etc...|
|Shares||enabled||enabled,disabled||add the samba shares from the shared-folders contrib in the nextcloud ibays folder along with regular ibays|
|IncludeIbay||empty||strings coma separated||add ibays names that need to be include. If not empty, only the name present here will be accessible via nextcloud. Take precedence over ExcludeIbay. You set it with a random string to exclude all ibays and shares from automatic inclusion.|
|ExcludeIbay||Primary||strings coma separated||will exclude from nexcloud access any ibay via nextcloud. Default excludes Primary ibay. If you want to include Primary set it with a random string.|
|opcache.memory_consumption||16||number||update this value if Nextcloud says that it should be|
|opcache.interned_strings_buffer||128||number||update this value if Nextcloud says that it should be|
|UseSMB||enabled||enabled,disabled||allow you to set ibay access via samba share or via Local driver in nextcloud. Enabled is for samba, this allow you to access as your user and have your quota accounted. It might be a little slower, and need you to have your password loaded in the session. Local driver if disabled, will let you access only what apache user (www) has right to access as member of a group.|
(*) the SME admin user is also an admin of your nextcloud installation. You have two admin account as per default installation on SME Server.
example of setting :
config setprop nextcloud ExcludeIbay ibay1,ibay2 signal-event nextcloud-update
LDAP/AD Integration Settings
Do not change the LDAP/AD integration settings for "1. Server: Localhost" or you will break the Nextcloud install. If you want to add a second LDAP/AD server, click the "+" symbol to add another configuration and then add the appropriate LDAP/AD settings.
if you happen to need tweaking your installation, here is how to access the command line for Nextcloud on SME, we made it easier for you, just log as root and use the OCC command (using capitals), This command will execute for you what you need as the www user, using the needed version of php. Here two examples:
occ maintenance:mode --off occ maintenance:repair
to seek for additional command consult Nextcloud documentation : https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html
yum update smeserver-nextcloud nextcloud --enablerepo=smecontribs
CLI upgrade of Nextcloud software
You should rather prefer the online updater, but in case:
occ maintenance:mode --on sudo -u www /usr/bin/php74 /usr/share/nextcloud/updater/updater.phar --no-interaction occ upgrade occ maintenance:mode --off
In case of a huge db, you can choose the online updater and then only issue the db update doing
occ upgrade occ maintenance:mode --off
yum remove smeserver-nextcloud nextcloud-src
then if you have a rpm named nextcloud
rpm -q nextcloud
rpm -e --justdb nextcloud
this will remove the rpm from the db, without trashing your current app install and config.
those folders will then remain
- /usr/share/nextcloud : software and config
- /home/e-smith/files/nextcloud : user data
also you will have mariadb or mariadb105 with nextcloud db and user.
and finally, db configuration with entry for nextcloud.
of all of those remains as is a simple reinstall of the contrib will bring back nextcloud running.
In case of deleting either the db or part of the software folder upon reinstalling the contrib it will just stall in the process to avoid to have db and software version not in sync.
as per 2022/12:
|Release date||End of life|
If you are in the situation your are unable to update your nextcloud because of database requirements, you might need to install a newer and then migrate your db.
Here a simple procedure, after having the new db working as a sclo Mariadb105 for SME10 as example.
occ maintenance:mode --on mysqldump `config getprop nextcloud DbName` > nextcloud.sql echo "CREATE DATABASE IF NOT EXISTS `config getprop nextcloud DbName` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"| mysql105 mysql105 `config getprop nextcloud DbName`< nextcloud.sql echo "CREATE USER IF NOT EXISTS `config getprop nextcloud DbUser`@localhost IDENTIFIED BY '`config getprop nextcloud DbPassword`';"| mysql105 echo "GRANT ALL PRIVILEGES ON `config getprop nextcloud DbName`.* TO `config getprop nextcloud DbUser`@localhost; FLUSH PRIVILEGES;" | mysql105 occ config:system:set dbhost --value localhost:/var/lib/mysql/mariadb105.sock --type string occ maintenance:mode --off
After checking that all is working you can then delete yourself the old db from the previous mysql server, or keep it as a backup for a while. If it fails and just want to go back to previous state:
occ maintenance --on occ config:system:set host --value localhost --type string occ maintenance --off
# scan all, could take hours if you have a lot of files occ files:scan -v --all # scan all that is inside a username path (including external storages mounted there) occ files:scan -v myusername #scan only a subfolder of a user (path needs a heading / and is relative to /home/e-smith/files/nextcloud/data) occ files:scan -v --path="/myusername/files/myfolder/mysubfolder" myusername #For external storage one has to use a user and the mount point in the user space, e.g. admin occ files:scan -v --path="/admin/files/name_of_external_storage"
If you use groupgfolders app, then you might consider, to list the golders id
then for folder group with id 1
occ groupfolders:scan 1
Issue importing files in db "Entry path/to/file will not be accessible due to incompatible encoding"
yum install convmv --enablerepo=epel #first test to see the changes convmv -f utf-8 -t utf-8 --nfc -r /home/e-smith/files/nextcloud/data/username #check, then with --notest convmv -f utf-8 -t utf-8 --nfc -r --notest /home/e-smith/files/nextcloud/data/username #then rescan occ files:scan -p /username/files/
this might also occurs on ibays / home folders and their files not all visibles from nextcloud, simply adapt the path for convmv /home/e-smith/files/ibays/ibayname/files/ or /home/e-smith/files/users/userame/home/
for installs done before smeserver-nextcloud 1.2.0-16, the rppm nextcloud was required and was conflicting with web update. Since 1.2.0-16 it is not required anymroe and we use a nextcloud-src rpm which updates itself in /usr/share/nextcloud-src and is only used if you install the first time or restart from scratch your install. TO remove the nextcloud rpm which is not needed and save your files, two ways
mkdir /usr/share/nextcloud-back rsync -arv /usr/share/nextcloud/ /usr/share/nextcloud-back rpm -e nextcloud rsync -arv /usr/share/nextcloud-back/ /usr/share/nextcloud rm -rf /usr/share/nextcloud-back
2 inplace (you can backup also before in case ...
rpm -e --justdb nextcloud
After a new install the admin user could see shares but not a user.
We had a single ibay and it was set:
Group Everyone Write group Read everyone
We created a new group called localusers and added the admin and single user.
We then set the ibay:
Group localusers Write group Read group
This appeared to fix the issue and the user could now see the files.
Upgrading beyond 20.x
To set the default phone region:
OCC config:system:set default_phone_region --type string --value="GB"
To fix missing indices - this may take a while so be patient:
NC 20-21 : open_basedir restriction in effect. File(/templates/) is not within the allowed path
this is a bug in NC. It has been fixed in NC 22 and not backported to NC20. This is just log noise. You can ignore it while waiting to update see https://help.nextcloud.com/t/error-file-templates-is-not-within-the-allowed-path-s-after-update-from-20-xx-to-21-0-3/119843
For reference, whilst looking at resetting file caches I found this.
It is probably extremely dangerous but wanted to make a note.
Please raise bugs under the SME-Contribs section in bugzilla and select the smeserver-nextcloud component or use this link
Below is an overview of the current issues for this contrib:
|ID||Product||Version||Status||Summary (9 tasks) ⇒|
|12356||SME Contribs||10.0||UNCONFIRMED||Migration to latest available PHP|
|12339||SME Contribs||10.0||CONFIRMED||recognize app needs access to /proc/cpuinfo|
|12329||SME Contribs||10.0||CONFIRMED||Get rid of nextcloud signup in the footer|
|12318||SME Contribs||10.0||CONFIRMED||Need to upgrade to at least version 25.0.3 for LDAP backend bug|
|12308||SME Contribs||10.0||CONFIRMED||smeserver-nexcloud overwrite.cli.url needs url value escaping and custom url setting|
|12298||SME Contribs||10.0||CONFIRMED||upgrade php fpm pool version|
|11169||SME Contribs||10alpha||CONFIRMED||smeserver-nextcloud requires a modify script|
|10590||SME Contribs||Futur||CONFIRMED||NFR: limit access to some groups|
|10566||SME Contribs||10.0||CONFIRMED||NFR: split action nextcloud-occ-conf|
Only released version in smecontrib are listed here.
- increase action script speed [SME: 12319]
- typo fix [SME: 11890]
2023/01/11 Jean-Philippe Pialasse 1.2.0-22.sme
- use of runuser in place of sudo -u [SME: 11890]
usage of /usr/bin/occ where possibleremoval of /usr/bin/OCC
2023/01/09 Jean-Philippe Pialasse 1.2.0-21.sme
- update disabled_fucntions list [SME: 12277]
- allow customization of opcache for Nextcloud see wiki [SME: 12299]