Attempts to install ownCloud 10.0.10 on QNAP NAS TS-231P


#1

This is a report of an attempt to setup ownCloud 10.0.10 on a QNAP NAS.

The goal is to be able to maintain this ownCloud instance with minimal effort and minimal knowledge of command line.

Steps we went through

Installing ownCloud

  1. Installed ownCloud from the QNAP app store / package manager: it’s outdated ownCloud 8.0.3.

  2. Thought about updating the source code in /home/Q*/owncloud/owncloud to a
    later version but remembered seeing that QNAP has an old PHP version or other dependency issues. (this post mentions libxml)

  3. Did not find PHP version as we could not find the “php” command. Probably PHP only works with Apache2, no CLI. Decided against creating phpinfo.

  4. Considering docker: we installed “QNAP container station”

  5. Found official ownCloud docker from ownCloud GmbH: owncloud/server => after installing, could not boot it: “exec user process caused ‘exec format error’”. It turns out docker containers don’t all run on ARM. The official OC container does not support ARM currently: https://github.com/owncloud-docker/server/issues/78

  6. Tried the ownCloud docker from the Docker company (_/owncloud) => was able to install, but it’s deprecated.

Some infos about the container for future reference:

  • Distro is: Debian 9 (“apt” is the package manager)
  • Web path is /var/www/html

Setting up database

None of the official Mariadb or MySQL containers would run on ARM.
We decided to go with SQlite for now but am worried about future deprecation of
sqlite
and no migration to MariaDB possible currently.

Network setup

  1. Set up port mapping with fixed port on docker host to OC container:
    8082->443, 8083->80 in the container station UI.

  2. Setup port forwarding on Speedport router from outside to QNAP: 80->8083,
    443->8082. (fun fact that Speedport did not let us use fixed IPs for port
    forwarding, had to select the target from a dropdown)

  3. Struggled a while because IP address was not accessible from inside. Turns
    out that Speedport router does not have NAT loopback so had to test from another
    network.

  4. Domain name was already registered, the provider has an https “update URL” which we pasted into the
    QNAP DDNS under “Customized”. We added dummy user/password/host as these are not
    used when connecting to that URL.

Setting up SSL certificate

  1. In Container station, used "Terminal " mode to connect to the OC container

  2. Installed certbot for Let’s encrypt for Debian 9 using a tutorial, it automatically setup SSL
    on the Apache there => https worked from outside

  3. Then setup OC, edited config.php to add both the external domain and internal NAS domain in trusted_domains.

Remaining challenges:

  1. how to do updates ? we cannot replace the OC container as we modified it.
    will need to use OC’s built-in updater. (to be tested)

  2. missing NAT loop problem on router: either replace the router with one that
    supports NAT loop or setup a local DNS server on the NAS. Possible conflicts
    with router’s DHCP. Not too happy to manually configure all devices manually to
    connect to the NAS for DNS.

  3. OC image we used is deprecated https://hub.docker.com/_/owncloud/ and would
    need to use the official one https://hub.docker.com/r/owncloud/server/

  4. is the OC container volume part of QNAP RAID / backup ?

Next steps

  1. Setup system cron for ownCloud: https://doc.owncloud.org/server/10.0/admin_manual/configuration/server/background_jobs_configuration.html?highlight=cron#cron-jobs

  2. test ownCloud web updater in that OC container

  3. check if QNAP app store has a mariadb database to which the container could connect to

  4. or find a trustworthy database container that also runs on ARM

  5. see if there’s a way to update the PHP on QNAP OS to explore the alternative without docker

  6. fix container crashes with SIG_WINCH whenever we open the terminal in “Docker container station”, might need some package updates

  7. write down instructions for easy maintenance for updating OC and also updating the container’s Debian packages.

Notes

I’m aware that this way of using Docker containers isn’t suitable. Best would be to be able to replace the ownCloud container with one with a higher version.
It should also be possible to inject the SSL certificates using a mounted volume. But this all increases the complexity and did not have time nor experience to set it up that way.