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
Installed ownCloud from the QNAP app store / package manager: it’s outdated ownCloud 8.0.3.
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)
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.
Considering docker: we installed “QNAP container station”
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
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.
Set up port mapping with fixed port on docker host to OC container:
8082->443, 8083->80 in the container station UI.
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)
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
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
In Container station, used "Terminal " mode to connect to the OC container
Installed certbot for Let’s encrypt for Debian 9 using a tutorial, it automatically setup SSL
on the Apache there => https worked from outside
Then setup OC, edited config.php to add both the external domain and internal NAS domain in trusted_domains.
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)
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.
is the OC container volume part of QNAP RAID / backup ?
test ownCloud web updater in that OC container
check if QNAP app store has a mariadb database to which the container could connect to
or find a trustworthy database container that also runs on ARM
see if there’s a way to update the PHP on QNAP OS to explore the alternative without docker
fix container crashes with SIG_WINCH whenever we open the terminal in “Docker container station”, might need some package updates
write down instructions for easy maintenance for updating OC and also updating the container’s Debian packages.
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.