Nextcloud
Apparence
Links
Manual upgrade
![]() |
Updates between multiple major versions and downgrades are unsupported. |
Backup the database, the data directory and the config.php file.
# backup
tar czf /folder/nextcloud.tar.gz nextcloud
sudo mysqldump -rnextcloud.sql nextcloud
# download the latest Nextcloud Server release
wget https://download.nextcloud.com/server/releases/nextcloud-23.0.0.tar.bz2
# unpack it
tar -xjf nextcloud-*.tar.bz2
# disable cron task
sudo crontab -u www-data -e
# stop the web server (apache)
sudo a2dissite nextcloud
sc-reload apache2
# rename old version and move the new one
mv /var/www/nextcloud /var/www/nextcloud-old
mv ~/download/nextcloud /var/www
# copy the config
cp /var/www/nextcloud-old/config/config.php /var/www/nextcloud/config
# copy the data folder
cp /var/www/nextcloud-old/data /var/www/nextcloud
# adjust file ownership and permissions
chown -R www-data:www-data /var/www/nextcloud
find /var/www/nextcloud/ -type d -exec chmod 750 {} \;
find /var/www/nextcloud/ -type f -exec chmod 640 {} \;
# start the web server (apache)
a2ensite nextcloud
sc-reload apache2
# upgrade with the www-data user
chmod 755 /var/www/nextcloud
cd /var/www/nextcloud
sudo -u www-data php occ upgrade
chmod 750 /var/www/nextcloud
# disable the maintenance mode if required
sudo -u www-data php occ maintenance:mode --off
# enable cron task
sudo crontab -u www-data -e
|
![]() |
Check the version
|
Configuration
NGINX
/etc/nginx/sites-available/nextcloud.conf |
Create a php-fpm pool
/etc/php/8.2/fpm/pool.d/nextcloud.conf |
# get the PATH var
sudo -u www-data printenv PATH
|
Apache
/etc/apache2/sites-available/nextcloud.conf |
Pretty URL
config/config.php |
'overwrite.cli.url' => 'https://nextcloud.domain.fr/',
'htaccess.RewriteBase' => '/',
|
sudo -u www-data php /var/www/nextcloud/occ maintenance:update:htaccess |
Server tuning
MariaDB
Increase the cache of Mariadb so it won't use swap partition when it receives a burst of requests. !!! OPTIONAL !!!
/etc/mysql/conf.d/mysql.cnf |
[mysqld]
innodb_buffer_pool_size = 1G
innodb_io_capacity = 4000
|
-- get value in GB
SELECT @@innodb_buffer_pool_size/1024/1024/1024; -- default 128 MB
SELECT @@innodb_io_capacity; -- default 200
|
![]() |
Get the best value for innodb_buffer_pool_size |
Background jobs
# edit crontab for user www-data
sudo crontab -u www-data -e
# run cron.php every 5 minutes
*/5 * * * * php -f /var/www/nextcloud/cron.php
|
With admin account, change the Settings → Administration → Basic settings → Background jobs = Cron
Settings
Resetting a lost admin password
# change the admin password
sudo -u www-data php /var/www/nextcloud/occ user:resetpassword admin
|
Email server
Setting | Value |
---|---|
Send mode | SMTP |
Authentication method |
|
Authentication required | use same credential as for roundcube |
Server address | smtp.domain.fr:25 |
Apps
Installer des Apps:
- se connecter en admin
- cliquer sur l'icone du profile en haut à droite → Apps
Deck
Outils de gestion de taches similaire à Trello
Key | Value |
---|---|
IMAP host | mail.domain.net |
IMAP security | STARTTLS |
IMAP port | 143 |
SMTP host | mail.domain.net |
SMTP security | None |
SMTP port | 25 |
Talk
Chat, video & audio calls
Calendar
Installation sur Ubuntu 18.04
wget https://download.nextcloud.com/server/releases/latest-27.tar.bz2
tar xf latest-*.tar.bz2
sudo mv -T nextcloud /var/www/nextcloud
sudo chown -R root:root /var/www/nextcloud
# vérifier que les modules php suivant sont bien installés
dpkg -l php-zip php-gd php-curl php-imagick
# folders rights
sudo chown -R www-data:www-data apps
sudo chown -R www-data:www-data config
sudo chown -R www-data:www-data data
sudo chmod 750 config
|
create database nextcloud;
grant all privileges on nextcloud.* to 'nextcloud'@'localhost' identified by 'password';
flush privileges;
|
Errors
Memcache \OC\Memcache\APCu not available for local cache
/etc/php/7.4/mods-available/apcu.ini |
apc.enable_cli=1
|
The PHP memory limit is below the recommended value of 512MB
/etc/php/7.4/apache2/php.ini |
memory_limit = 512M
|
MySQL is used as database but does not support 4-byte characters
A memcache is not required and you may safely ignore the warning if you prefer
config/config.php |
'memcache.local' => '\OC\Memcache\APCu',
|