.. author:: Andreas Matschl | SpaceCode <andreas@spacecode.it>
.. tag:: lang-php
.. tag:: web
.. tag:: file-storage
.. tag:: collaborative-editing
.. tag_list::
Nextcloud is an open source cloud solution written in PHP and distributed under the AGPLv3 license.
Nextcloud was initially released in 2016 as a fork of ownCloud and is maintained by Nextcloud GmbH.
Note
For this guide you should be familiar with the basic concepts of
We're using :manual:`PHP <lang-php>` in the stable version 7.1:
[isabell@stardust ~]$ uberspace tools version show php
Using 'PHP' version: '7.1'
[isabell@stardust ~]$
If you want to use your cloud with your own domain you need to setup your domain first:
cd
to your :manual:`document root <web-documentroot>`, then download the latest release of the Nextcloud and extract it:
Note
The link to the lastest version can be found at Nextcloud's download page.
[isabell@stardust ~]$ cd /var/www/virtual/$USER/html/
[isabell@stardust html]$ curl https://download.nextcloud.com/server/releases/latest.tar.bz2 | tar -xjf - --strip-components=1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 37.5M 100 37.5M 0 0 5274k 0 0:00:07 0:00:07 --:--:-- 6062k
[isabell@stardust html]$
Now point your browser to your uberspace URL and follow the instructions.
You will need to enter the following information:
- Administrator username and password: Insert the credentials you want to use for the admin user
- your MySQL hostname, username and password: the hostname is
localhost
and you should know your MySQL :manual_anchor:`credentials <database-mysql.html#login-credentials>` by now. If you don't, start reading again at the top.- your Nextcloud database name: we suggest you use an :manual_anchor:`additional <database-mysql.html#additional-databases>` database. For example: isabell_nextcloud
For better performance, Nextcloud suggests to add a local cronjob.
Add the following cronjob to your :manual:`crontab <daemons-cron>`:
*/15 * * * * php -f /var/www/virtual/$USER/html/cron.php > $HOME/logs/nextcloud-cron.log 2>&1
To further enhance perfomance, enable Memcaching.
To enable Memcaching (APCu), add the following line to your /var/www/virtual/$USER/html/config/config.php:
[...]
'dbuser' => 'isabell',
'dbpassword' => 'eeCae1ahx6angai',
'installed' => true,
'memcache.local' => '\OC\Memcache\APCu',
);
Enable opcache to further optimise perfomance.
To do that, add the following lines to $HOME/etc/php.d/opcache.ini
:
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1
In order to increase the memory limit of php to the recomende value of 512 MB, go to $HOME/etc/php.d/
, create memory_limit.ini
and add the following line:
memory_limit = 512M
After that you need to restart PHP configuration to load the last two changes:
[isabell@stardust ~]$ uberspace tools restart php
Your php configuration has been loaded.
[isabell@stardust ~]$
Nextcloud will complain about your HSTS settings in the admin interface.
At the moment it is not possible to change the HSTS settings, as mentioned in the :manual:`manual <web-security>`.
The easiest way to update Nextcloud is to use the web updater provided in the admin section of the Web Interface.
If you have installed Nextcloud on a subdomain it can happen that the update fails: Access to the UI is not possible and HTTP 403 errors are thrown. In most cases this happens due to wrong SELinux labels which can be fixed with finishing the update via console and setting the labels according the loaded SELinux policy.
[isaball@stardust ~]$ cd /var/www/virtual/$USER/html
[isaball@stardust ~]$ php occ upgrade
[isaball@stardust ~]$ restorecon -R .
[isabell@stardust ~]$
Note
Check the changelog regularly to stay informed about new updates and releases.
Tested with Nextcloud 13.0.1, Uberspace 7.1.3
.. author_list::