Table of Contents

Back  
 Next
, , , ,

Nextcloud Container

Nextcloud publishes their own Docker container of Nextcloud. The Nextcloud image on Docker hub is maintained by the Nextcloud community, and is not officially supported by Nextcloud! Linuxserver.io, as well as some others also have Nextcloud containers on Docker Hub.

Nextcloud needs a number of services to run; the main Nextcloud server, a database and Redis. In addition, there needs to be a proxy server or similar to forward on common domain requests to sub-domains as well as handling certificates, however this is required for all the various services and can be considered separately.

Refer to Nextcloud's Maintenace section on instructions to backup, restore and migrate Nextcloud. Also as I am using the official Nextcloud container it has additional instructions to https://github.com/docker-library/docs/blob/master/nextcloud/README.md#migrating-an-existing-installation:migrate Nextcloud to Docker.

Nextcloud with supervisord

The base Nextcloud image does not directly support cron. So it needs to be added, for the nextcloud-fpm.alpine version see github nextcloud docker fpm-apline cron dockerfile examples

tl;dr;

As docker adminstartion warns about missing php imagemagick-svg support I also added the Apline package to the updated image to rectify this warning.

Dockerfile

supervisord.conf

docker-compose.yml

RedirectRegex

I get a redirect error in Nextcloud that I have not been able to track down to date. Does not seem much info in this on the net, and the little there is also indicates a problem without and easy solution. Nextcloud main support looks Apache web server based with little Nginx support and even less Traefik support. Some resources related to this:

mysql

Installing and Using MariaDB via Docker

Installing and Using MariaDB via Docker start

logging

The db logs seem to redirected to be handled by Docker container and can be access using: docker container logs nextcloud-db-1

backup

The Nextcloud Backup instruction are reasonably comprehensive. There are 2 backup that need to be made, both the Nextcloud data and configuration and the related mysql/mariadb data(base).

Step 0 is to gain shell access to relevant container

Step 1 is to place Nextcloud into mainteance mode sudo -u www-data php occ maintenance:mode --on\

Step 2 is to backup the Nextcloud data and configuration.

Step 3 is to back up the Nextcloud database:

The simplest solution for me is to shutdown the Docker-compose for the Nextcloud instance, including all containers that make the stack and then run my Restic back up with a tag to keep this snapshot.

back-up server#tag

NGINX configuration

Nextcloud documentation (stable) on NGINX configuration

Nextcloud documentation (stable) on general installation installation index.

Reverse Proxy

Nextcloud documentation (stable) for reverse proxies, such as traefik.

cron

CLI Use of Nextcloud

Sometime it is necessary to get direct CLI (command line interface) access to Nextcloud for updating, turning of maintenance mode and similar.

Listing of:

php occ

File Integrity Check

This error is a bit painful. In the nextcloud instance (container)”

  1. Basically check the files that are called up as failing integrity.
  2. Judiciously delete files where they are not needed.
  3. Then run command: php occ integrity:check-core.

Nextcloud runs integrety:check-core when starting. So if manually cleaning-up Nextcloud to remove errors Nextcloud needs to have command manually run or restarted.

Nextcloud Client and CLI client configuration

The basic Nextcloud client is a program installed for GUI use. You basically just install the gui program/app and use it, see Nextcloud Install. OPtions to install include sudo apt install nextcloud-desktop or install via AppImage the release can be found here: https://download.nextcloud.com/desktop/releases/Linux/

There is also a CLI program included called nextcloudcmd there seems to be a method to use the AppImage package to access the command, see here: Where to download just nextcloudcmd? In debian sudo apt install nextcloud-desktop-cmd will down load nextcloudcmd, however it will also download the bulk of the dependencies for nextcloud desktop too.

Another possible option is to use webdav to access the Nextcloud repository and rsync latest files between these. See: davfs2. The Nextcloud directory can be mounted locally and then use rsync to copy latest common files between local and Nextcloud. This can be used to sync two local computers.

References

Nextcloud Office / Collabora

Nextcloud can run an internal server for Collabora, a LibraOffice based online type office server, or a separate Collobora server. I never got the internal server working. I got a Collobora server operating in a Docker container and then managed to get Nextcloud to operate with the server. I have placed the Collabora server behind my Traefik server and given it a local address only. The local address means that the Nextcloud server can not access the Collabora server unless it is operating on the LAN. It is not difficult for me to setup the Collabora server for external access, but I need to think and investigate the potential security issued with this as a public facing server.

collabora docker-compose.yml

The sensitive data is stored in a file .env

Collabora References

Other Possible Apps/Images

Back  
 Next