- Latest QNAP Firmware Installed.
- Container Station Installed & Updated.
- Understand how to access your QNAP via SSH. Access my QNAP NAS using SSH
Create a new user which will be used for docker containers, so that they are not running as root (primarily for security reasons). Go to "Users" from the main screen QTS, select "Create User" and create a user called "dockeruser"
Create a new shared folder that we will keep all docker appdata in. Load up "File Station" and create a new share by clicking on the +
next to the Data Volume.
Call the folder Docker
and give full read/write access to this folder to the newly created dockeruser
. Everything else can be left as default.
Once the Docker
folder is created, create another folder called nextcloud
within the Docker
folder.
Now the UID/GID of the user dockeruser
need to be figured out. Use your favourite method to ssh into the QNAP NAS and run the following command:
id <username>
Replace with the user you created earlier (dockeruser). The result of the command should look like this:
Result:
[~] # id dockeruser
uid=500(dockeruser) gid=100(everyone) groups=100(everyone)
[~] #
Note the UID and the GID and replace the ID's in the docker-compose.yml file (see comments in the docker-compose file).
Create a new container based on the docker-compose.yml file.
Open the Container Station
and select Create
from the management menu. Click on the Create Application
button.
Download the docker-compose.yml from the repository and replace the passwords and the dockeruser id/group (see comments in the docker-compose file).
Choose a name for the Container and paste the content of the docker-compose.yml into the YAML section and click on the create button.
After the container is created, open the Nextcloud web interface on https://NAS-IP:9443/
Fill in the credentials for the administrator account.
Select MySQL/MariaDB as database and use the database credentials defined in the docker-compose.yml file. (MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, container_name)
Click Install
to finish the Nextcloud setup.
To keep everything up to date the containers and the Nextcloud installation have to be updated.
Stop the running Nextcloud container.
Press on edit
and copy the docker-compose file of the Nextcloud container (which contains the actual passwords, user Id, user group).
Press on delete
to delete the existing Container (Alle user specific data is stored outside of the container).
Select Images
from the management menu and remove the images linuxserver/nextcloud and linuxserver/mariadb.
Select Create
from the management menu. Click on the Create Application
button.
Choose a name for the Container and paste the previously copied docker-compose file into the YAML section and click on the create button.
After the container is created, it uses the latest images.
After updating the container open the Nextcloud web interface on https://NAS-IP:9443/ and login as administrator. Go to the settings and use the built-in updater to update the Nextcloud installation. See the Nextcloud documentation for more details.