Nextcloud update using cli only

Nextcloud 14.0.4 -> Nextcloud 15


Nextcloud can be updated using the Nextcloud command line interface only. Even your enabled apps will be updated as far as they are available on the Nextcloud app store. But first backup your Nextcloud system (database and data).


Last Updates:

December, 13th 2018:
– added shell scripts for Ubuntu and Debian


sudo -s
cd /var/www/nextcloud
sudo -u www-data php updater/updater.phar

Press y to start updating your Nextcloud and y again to continue

Now the code was updated. Press n to disable Nextclouds maintenance mode and the update has ben finished already.

You are on the latest Nextcloud release – it can be verifed by

sudo -u www-data php /var/www/nextcloud/occ status
sudo -u www-data php /var/www/nextcloud/occ -V

At least modify Nextclouds .user.ini

sudo -u www-data sed -i "s/upload_max_filesize=.*/upload_max_filesize=10240M/" /var/www/nextcloud/.user.ini
sudo -u www-data sed -i "s/post_max_size=.*/post_max_size=10240M/" /var/www/nextcloud/.user.ini
sudo -u www-data sed -i "s/output_buffering=.*/output_buffering='Off'/" /var/www/nextcloud/.user.ini

Verify all apps are up to date

sudo -u www-data php /var/www/nextcloud/occ update:check

and restart both, PHP and NGINX.

service php7.2-fpm restart && service nginx restart

Keep it simple – download all as a shell script:

Nextcloud-upgrade-on-ubuntu.sh

Nextcloud-upgrade-on-debian.sh

That’s it.


Enjoy your personal data in your secured and hardened Nextcloud-Server!

Don’t forget to backup your Nextcloud

Find more instructions here: Nextcloud Backup and Restore



Carsten Rieger

Carsten Rieger

Carsten Rieger is a senior system engineer in full-time and also working as an IT freelancer. He is working with linux environments for more than 13 years, an Open Source enthusiast and highly motivated on linux installation and troubleshooting. Mostly working with Debian/Ubuntu Linux, Nginx and Apache web server, MariaDB/MySQL/PostgreSQL, PHP, Cloud infrastructure (e.g. Nextcloud) and other open source projects (e.g. Roundcube) and in voluntary work for the Dr. Michael & Angela Jacobi Stiftung for more than 6 years.

5 Responses

  1. Marco says:

    Hi,

    ich habe dein Script für die Nextcloud Installation benutzt, danke dafür.
    Allerdings habe ich nun folgende Fehlermeldung wenn ich von Version 14.0.3 auf Version 14.0.4 aktualisieren möchte.

    ***
    Could not copy “/var/www/nextcloud/config/config.php.orig” to “/var/nc_data/updater-oc751ztl6eab/backups/nextcloud-14.0.3.0/config/config.php.orig”. Source /var/www/nextcloud/config/config.php.orig is not readable. Destination /var/nc_data/updater-oc751ztl6eab/backups/nextcloud-14.0.3.0/config/config.php.orig is not writable
    ***

    Kannst du mir sagen wie ich das beheben kann?

    Besten Dank.

  2. Manni says:

    .. wieder mal eine geniale meisterliche Anleitung. :o))))))

    Wenn man sich an die Anleitungen hält, klappt das mit dem Nachbar, ähh Nextcloud.

Leave a Reply

Your email address will not be published. Required fields are marked *