Nextcloud
Create folder
/volume1/docker/nextcloud
and create or update here the following:An
.env
file with your data (e.g.):Passwords for DB (random/strong) & SMTP server
db_password.txt
smtp_password.txt
The official suggested nginx.conf file
Container Manager
Create new project nextcloud on above folder with the content below
Control Panel -> Login Portal -> Advanced -> Reverse Proxy
Create a new proxy for Nextcloud, e.g. https://your.domain -> http://192.168.1.1:8080
Enjoy Nextcloud
Assumptions
You have installed Container Manager
The folder
/volume1/docker
has been created
docker-compose.yml
Variant: MariaDB on DSM
You can use of course the regular Synology package for MariaDB.
In this case just remove the db service/section in the docker-compose.yml file above and set accordingly MYSQL_HOST variable.
Variant: Shared folder on DSM
You can use a regular folder on your NAS.
Control Panel -> Shared Folders
Create new nextcloud shared folder
On tab General, check only "Hide this shared folder..."
Set permissions for www-data user/group (ID 82 in alpine images) to that folder (e.g.
/volume1/nextcloud/data
)Add the proper mapping to the app service in docker-compose.yml
Migrate existing installation
The following instructions are based on official documentation referenced here below and some practical experience.
Prepare a brand new stack of Nextcloud (i.e. destination), by also adding the admin user
(opt?) Stop it
From the source stack of Nextcloud
Copy or move
html/config/config.php
Copy or move
html/data/
, and make sure user www-data has 0770 permissionsCopy or move DB
Start the destination again
Backup and restore MariaDB
Backup
Restore
Running commands from DSM shell
Running commands from container
Permissions on data folder
Data folder:
/var/www/html/data
Owner: www-data/www-data
Permissions: 0770
Depending of used architecture in containers, you should use www-data internal ID instead of user/group names.
Apache: 33
FPM/nginx: 82
How to
Recover data when seems lost
For some reason data could disappear but is still present on file system.
Try to rescan files using the command php occ files:scan --all
.
Fix errors when configuring SMTP
Double check the right settings (i.e. port 465); see https://support.google.com/mail/answer/7126229
(Google) Generate an app password for Nextcloud
Clear all logs
Set maintenance mode ON
Delete data/nextcloud.log file
Set maintenance OFF
Unblock a locked file
If you get an HTTP 423 (file locked) error, you could fix as documented.
Set maintenance mode ON
Clean the locks table oc_file_locks
Set maintenance OFF
References
Last updated