I’m running a nextcloud instance in a docker container witch nginx proxy manager handling the SSL for the site. All running on UnRaid.
Unfortunately this has caused some issues, chief among them being able to actually update the nextcloud installation. I’ve, as yet, been unable to find a permanent solution that will prevent timeouts during upgrades, so instead I’ve opted for updating via the terminal. It’s extremely straight forward, so I’ll lay out the steps and hopefully help someone who is struggling with it, as keeping your NextCloud up-to-date when it’s internet facing is quite important.
Manual upgrade procedure:
Open the docker terminal via the UnRaid GUI.
Turn on maintenance mode:
sudo -u abc php occ maintenance:mode --on
This will ensure that your Nextcloud instance is in maintenance mode. It’s got friendly console output, so if it works you’ll know.
Now, we’ll want to ensure we have a backup of our nextcloud install, just in case anything goes awry, so we’ll do that real quick:
sudo -u abc
mv nextcloud nextcloud-backup
This essentially renames your nextcloud directory. You can use ls to verify that it’s renamed.
Now we’re going to grab the NextCloud update, and it’s important to note that you can only update one major version at a time. If you’re far behind in the update schedule you will need to update one version at a time.
We’ll go to https://download.nextcloud.com/server/releases/ and grab the link for our needed version, in my case – since I keep a tidy house, I’ll be using https://download.nextcloud.com/server/releases/latest.tar.bz2 as that’ll always be the latest version. You can find your version info in the admin panel, if you’re in doubt.
Now we need to grab and extract the data:
and to extract:
sudo -u abc
tar -xvf latest.tar.bz2
It can take a while to unpack, but once it’s done we need to grab our config file from our backup and place it in to the newly created nextcloud folder, like so:
sudo -u abc cp nextcloud-backup/config/config.php nextcloud/config/config.php
Now restart the docker container through the UnRaid Web GUI.
Once that’s done, we’re ready to start the upgrade proper:
sudo -u abc php occ upgrade
This will take a while. Once finished, stop maintenance mode:
sudo -u abc php occ maintenance:mode --off
And restart your docker container.
Now, we wait for NextCloud to finish starting up, and verify that all is as it should be. Usually I find there’ll be some commands that you need to run manually post-upgrade, they’ll pop up as notifications in the admin panel in NextCloud, so do be sure to check that they are run as well.
Lastly we have to do cleanup, as no-one likes a cluttered system, right?
rm -R nextcloud-backup will take care of your backup directory.
rm latest.tar.bz2 will take care of the downloaded tarball.