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 and sha256.
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
# 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.
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.
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.
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.
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.