Skip to main content

Nextcloud update / Upgrade to newest version

To update Nextcloud when automatic updating is disabled in the config.php file from a local machine, you need to use the command line updater (occ upgrade). Here are the steps:
  1. Open a terminal and navigate to the Nextcloud root directory.
  2. Run the following command to start the command line updater:
sudo -u www-data php occ upgrade

To run the occ upgrade command from outside the Nextcloud Docker container named "nextcloud", you can use the docker exec command like this:
sudo docker exec --user www-data nextcloud php occ upgrade
Here's a breakdown of the command:
  • sudo docker exec - This allows you to run a command inside a running Docker container.
  • --user www-data - This specifies that the command should be run as the www-data user, which is the recommended user for running Nextcloud commands.
  • nextcloud - This is the name of your Nextcloud container.
  • php occ upgrade - This is the actual command to upgrade Nextcloud using the occ command-line tool.

So, the full command sudo docker exec --user www-data nextcloud php occ upgrade will execute the php occ upgrade command inside the "nextcloud" container as the www-data user, which is the recommended way to perform the Nextcloud upgrade.