Nextcloud is a suite of client-server software for creating and using file hosting services. Nextcloud is free and open-source, which means that anyone is allowed to install and operate it on their own private server devices.
With the integrated OnlyOffice, Nextcloud application functionally is similar to Dropbox, Office 365 or Google Drive, but can be used on home-local computers or for off-premises file storage hosting.
The original ownCloud developer Frank Karlitschek forked ownCloud and created Nextcloud, which continues to be actively developed by Karlitschek and other members of the original ownCloud team.
Download the latest sourcecode.
First we install the APCu memory cache:
# dnf install php-pecl-apcu # cd /etc/php.d # vi 40-apcu.ini apc.enable_cli=1 # systemctl restart php-fpm httpd
# cd /etc/php.d/ # vi 10-opcache.ini opcache.interned_strings_buffer=12 # systemctl restart php-fpm httpd
Read the installation guide.
We need to create a virtualhost for our cloud.
# cd /srv/www/vhosts # mkdir -p cloud.example.com/httpsdocs # cd /srv/www/vhosts/cloud.example.com/httpsdocs/ # cp -R <path to nextcloud unzipped dir>/* . # cd .. # chown -R apache:apache # cd httpsdocs/ # chcon -R -t httpd_sys_rw_content_t * # cd /etc/httpd/conf/vhosts.d/ # cp vhosts.con cloud.example.com.conf # vi cloud.example.com.conf // Edit this file for your needs.
The vhosts.conf template is used and must be changed to your needs.
Also remove the first and second virtualhost.
<VirtualHost *:80>
ServerName example.com
....
<VirtualHost *:443>
ServerName example.com
We keep the third and fourth virualhost.
Start with replacing example.com to your domain.
After you configure the server you need to restart the webserver.
# httpd -t # systemctl restart httpd
You need to add cloud to your DNS example.com zone. Restart the DNS.
# cd /var/named/dynamic/
# vi example.com
.....
$TTL 10800 ; 3 hours
cloud CNAME server1
.....
server1 A 192.168.1.11
AAAA 2a02:.....::1:1
.....
# systemctl restart named
Extract the zip-file and move the files to the server root.
# unzip latest.zip # cd nextcloud # mv * /srv/www/vhosts/cloud.example.com/httpsdocs/ # cd /srv/www/vhosts/cloud.example.com/httpsdocs/ # ll total 912 drwxr-xr-x. 42 apache apache 4096 Jun 26 15:32 3rdparty -rw-r--r--. 1 apache apache 26375 Jun 25 12:20 AUTHORS -rw-r--r--. 1 apache apache 34520 Jun 25 12:20 COPYING drwxr-xr-x. 2 apache apache 4096 Jun 26 15:32 LICENSES -rw-r--r--. 1 apache apache 36893 Jun 25 12:20 REUSE.toml ..... #
# cd /srv/www/vhosts/cloud.example.com/httpsdocs/config
# vi config.php // Adjust to your needs.
.....
'overwrite.cli.url' => 'https://cloud.example.com/',
'overwritehost' => 'cloud.example.com/',
'overwriteprotocol' => 'https',
.....
'logo_url' => 'https://cloud.example.com/',
'maintenance' => false,
'mail_smtpmode' => 'smtp',
'mail_sendmailmode' => 'smtp',
'mail_from_address' => 'nextcloud',
'mail_domain' => 'example.com',
'mail_smtphost' => 'localhost',
'mail_smtpport' => '25',
'mail_smtpsecure' => '',
'mail_smtpauth' => false,
.....
'memcache.local' => '\OC\Memcache\APCu',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => '/run/redis/redis.sock',
'port' => 0,
'timeout' => 0.0,
),
'redis_log_file' => '/var/log/redis/redis_nextcloud.log',
.....
You need TLS for this.
Use your wildcard certificates.
We need to create a crontab job.
Add to the apache crontab:
# crontab -u apache -e */5 * * * * sudo -u apache php /srv/www/vhosts/cloud.example.com/httpsdocs/cron.php
This run cron.php every 5 minutes.
Create an email-account for nextcloud.
Enter the SMTP settings. We have already set it in the config.php file.
Click on "Save" and "send mail" to test the settings.
Default is -1, and values between 0 and 1023 are considered non-empty)
# cd /srv/www/vhosts/cloud.example.com # ./occ config:system:set serverid --value=0
Some apps are part of the install, but you can add more apps.
Previously, Nextcloud only supported applications written in the PHP programming language. In order to support a wider range of use cases, an ecosystem for ExApps (short for "External Apps") was introduced, allowing for the installation of apps as Docker containers.
See here for setup.
Whiteboard is an optional app you can install.
You need for this app an websocketserver.
If updating on-line doesn't work. Do it manual.
# cd /srv/www/vhosts/cloud.example.com/httpsdocs/updater # sudo -u apache php updater.phar // Follow the instructions.
Refresh browserscreen ..../admin/overview. When errors correct them.
To update the apps enter:
# cd /srv/www/vhosts/cloud.example.com/httpsdocs/ # sudo -u apache php occ app:update --all
Nextcloud is strict with its files. You can't add files to the directory structure.
That also means you can't use lets-encrypt unless you have a wildcard certificate.