How to install NC on Docker on Synology

I ran NC16-18 on my Synology DS218+ for my home / work sync of data on my machines.
Iā€™m fine with command line stuff but as a HW engineer I donā€™t have the time anymore to devote on learning myself up on the intricacies of linux services etc and piping which version of php.ini to where. I did compile a linux kernel once to include network drivers - but that was 2 decades ago.

Note everything is local network only.

Eventually the system fell over and there were too many php related incompatibilties between Synology releases and NC.

Fast forward to now, Synology is on DSM7 and I believe that a docker container is the best way to get NC up and running for a single user environment.

I cannot find a good tutorial for installing NC and MariaDB in docker as per my system - everything seems very out of date.

The closest I found was synology-docker-mariadb-nextcloud-install

Iā€™m using the linuxserver docker images, as the github/docker ones were inscrutable to me.

Started to sync my stuff to my nextcloud docker instance. After a while, slows to a halt and ā€œfile lockā€ issues.
As this is now docker - I donā€™t know how (or where) to ssh into to run occ tools or access my database, e.g.

Of course Iā€™ve tried a bunch of stuff, but everything is a blind end (my docker user is nextcloud:docker).
Where is a good tutorial on how to install this in a docker? And a good tutorial for how to do maintenance in docker installs (NC still seems to be flakey and DB maintenance needs to be done by hand)?

What about this one:

That is not helpful and in fact rather rude.

There are plenty of shitty or incorrect tutorials on the internet on how to setup stuff up badly (to wit: OpenVPN).
There are also plenty of crappy cooking sites on how to make chili.

I was hoping that someone might have a ā€œknown goodā€ tutorial, as I can imagine that things written a number of years ago are no longer recommended or supported.

1 Like

Hello @snownc,

may I suggest you to try out the new Nextcloud All-in-One appliance on your Diskstation? It should run pretty well without much maintenance once correctly started. I currently donā€™t have a complete guide but the basic steps are:

  1. Install Docker on your Diskstation via the Synology Packet Center
  2. Enable SSH acces to your Diskstation and connect to your Diskstation using SSH (Enable SSH Access On A Synology - krypted)
  3. Run the startup command that is pointed out here: Run the following command in order to start the container:
  4. Open the interface via https://internal.ip.of.your.diskstation:8080

This should basically be it.

Hope it helps! :slight_smile:

Interesting - though Iā€™m a bit worried as itā€™s still quite ā€œbetaā€, right? (Iā€™m using the system for consultancy work, so data loss and downtime would be a major issue).

Does this work as a custom VM?

I managed to start repairs to work - had to use the PUID number rather than the user name - something Iā€™ve never experienced.

ssh into nas thenā€¦
then

sudo docker exec -u 1031 linuxserver-nextcloud  php /config/www/nextcloud/occ maintenance:mode --on

and similarly for the repair and occ file:scan

But Iā€™m still not sure if I have set up the who caboodle correctlyā€¦

It is already quite stable for the beta status but that is of course up to you to decide if it is fine.

Yes that should work by simply installing your linux distro of choice and then following the steps in the readme.

is the 2-core 2GB Celeron in the DS220+ likely to be a severe bottleneck though - as it has to run DSM7 as well.

Right, that could be a problemā€¦

Just tried the Nextcloud official docker build (which is 22.something). Which does not work for meā€¦
(and goes to show why I would like a good tutorial)

Initializing nextcloud 22.2.3.0 ...

Initializing finished

New nextcloud instance

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message

[Thu Feb 03 07:35:58.496849 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.52 (Debian) PHP/8.0.15 configured -- resuming normal operations

[Thu Feb 03 07:35:58.496916 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

[Thu Feb 03 07:36:12.471753 2022] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully

After weeks of trying to install in docker I finally stumbled into getting it to work, itā€™s really fairly easy:

In docker using Portainer go to Stacks then Add Stack then pasted below into editor and then deployed the stack and voila IT WORKED !!!

version: ā€˜2ā€™

volumes:
nextcloud:
db:

services:
db:
image: mariadb
restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=(password of your choosing)
- MYSQL_PASSWORD=(password of your choosing)
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud

app:
image: nextcloud
restart: always
ports:
- 8080:80
links:
- db
volumes:
- nextcloud:/var/www/html
environment:
- MYSQL_PASSWORD=(password of your choosing)
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db

2 Likes

I was about to try this, but i get the following error:

There is an error in the yaml syntax: YAMLSemanticError: Map keys must be unique; ā€œvolumesā€ is repeated

There are repeated fields in this.