Linux Format

Bleedin’ COOL

Now we can tweak our Nextcloud install and engage in some glorious document-related productivi­ty and collaborat­ion.

-

If you’re familiar with LibreOffic­e, you should have no problem navigating Collabora Online’s interfaces. From the Files app (the folder icon in the top-left of Nextcloud’s interface), use the big + button to create a new document, spreadshee­t, presentati­on or even diagram. If you want to be able to save the latter as SVG files (rather than PDFs), an extra package is required:

$ sudo apt install libmagickc­ore-6.q16-6-extra

By default, CODE apps start with the newfangled NotebookBa­r interface, which is a bit like Microsoft Office’s Ribbon interface, but less awful. If you prefer the classical buttons and menus arrangemen­t, you can add the following to the extra_params parameter in the Docker incantatio­n (remember to stop and remove the previous container, to preserve memory and disk space):

--o:user_interface.mode=classic

Staying up to date

One advantage of using CODE through Docker is that it’s very easy to update the image. Not only that, but because CODE doesn’t need any persistent storage (all the storage is handled on the Nextcloud side), we don’t need to back up anything before we update it. A simple $ sudo docker pull collabora/code will avail you of the latest release. You can also download a particular version – look at the available releases in the Tags section of the Dockerhub page at https://hub.docker. com/r/collabora/code.

Updating Nextcloud is also easy. And if you’re lucky, takes only a few clicks. From the Administra­tion Settings page, scroll down to the Update section and see if a new version is available. If so click, start the updater and follow the prompts. If you like to live on the edge, you can even change to the Beta update channel. You get to keep all the pieces if it breaks.

The updater creates a backup in /var/www/ nextcloud/data/updater-xyz (the last characters are random). This is deleted if the upgrade is successful. It’s worth checking for stray backups periodical­ly. Keep an eye on the Nextcloud directory’s total bulk, too, with:

$ sudo du -h /var/www/nextcloud

In general, you shouldn’t touch the nextcloud/data

directory from the command line. Everything there should be manipulate­d through the web interface, otherwise Nextcloud gets confused. Nextcloud stores multiple versions of files (through its imaginativ­ely titled Versions app), and has a reasonably smart policy for deleting stale ones (which you can read about at

https://docs.nextcloud.com/server/latest/admin_ manual/configurat­ion_files/file_versioning.html).

If you’re running a quite old version, you’re updated to the next maintained release after it. So if you want to update to the latest and greatest edition, you have to do so in stages (the upgrader does not support going from Nextcloud 25 to Nextcloud 27, for instance). You have to confirm app upgrades across each version, too.

If you’re on a slow connection, the web installer might time out when doing upgrades or installing apps. It’s set to do this after two minutes, for the sake of usability. We ran into this difficulty when experiment­ing with the Built-in CODE Server app. Fortunatel­y, Nextcloud comes with a PHP tool for administra­ting it from the command line. That command is occ

and you can run it as follows (this installs said CODE server, code-named richdocume­ntscode – you can find app code names from their respective pages):

$ cd /var/www/nextcloud

$ sudo -u www-data php occ app:install

richdocume­ntscode

You should see the following reassuring message:

richdocume­ntscode 23.5.5 installed richdocume­ntscode enabled

You might also want to run Nextcloud’s updater from the command line – if the graphical updater eats too much memory and crashes, for instance. To do so, run the following from Nextcloud’s directory.

$ sudo -u www-data php occ upgrade

Pernicious PHP

We’ve covered installati­on on Ubuntu, but these instructio­ns work for the recently released Debian 12 (Bookworm), too. Nextcloud 27 requires at least PHP 8.0. The previous release (Bullseye) only supports PHP 7.4, and in testing, we could only install Nextcloud 25 there. If you want the latest and greatest without upgrading from Bullseye, there are unofficial backported PHP packages at https://deb.sury.org/. PHP 7.4 went EOL in November 2022, and this is a perennial issue stemming from Debian’s long release cycle juxtaposed against Nextcloud’s rapid developmen­t.

Besides replacing Google’s Workspace with CODE,

Nextcloud can also replicate long-dead services such as Google Reader. If that name doesn’t stir a tear from your eye, it was quite a useful tool for collating RSS and atom feeds from blogs and news sites. While some argue that no one uses these feeds any more, and others point to the few desktop reader apps (such as the venerable Liferea), we still like the idea of being able to browse headlines from our favourite tech tabloids from a central location. Enter Nextcloud News,

truly one of the most under-rated Nextcloud apps.

Another simple but devastatin­gly useful app is Nextcloud Notes, which can replace sticky notes (virtual and physical), as well as Google’s Keep. News and Notes come into their own when used via their respective mobile apps (again available from F-Droid as well as the usual app stores). With the Nextcloud mobile app already installed, you don’t even need to give News or Notes any connection or account info.

Nextcloud can also do video calls in the style of Microsoft Teams or Google Hangouts (or Meet, or whatever it’s called now). Just install Nextcloud Talk

from the Social & Communicat­ion section of the app catalogue. If you don’t like Nextcloud’s take on video conferenci­ng, it can integrate with Jitsi, too. Indeed, there’s a whole section of Integratio­ns on the App page, allowing Nextcloud to communicat­e with Discourse, Element, GitLab, Mastadon, even OpenAI.

Nextcloud’s default configurat­ion is pretty secure, so if you started from a minimal Ubuntu server install (and followed best practices like setting up passwordle­ss SSH logins, Fail2ban and regularly updating), chances are you’re fine. But that doesn’t mean you shouldn’t do the Nextcloud Security Scan at https://scan.nextcloud.com. Enter your server address and all kinds of probes and prods are carried out by Nextcloud’s infrastruc­ture. It will almost certainly come back with some improvemen­ts.

For example, it’s recommende­d to run Nextcloud on its own domain rather than (as we have) in a subdirecto­ry. This allows you to leverage Same Origin policies and prevent attacks based around embedding Nextcloud in an HTML