Setup and Install NextCloud On Synology

Setup and Install NextCloud On Synology

Install NextCloud on Synology

Installing nextcloud on your Synology NAS

full course
  1. Setup and Install NextCloud On Synology
  2. NextCloud Configuration
  3. Login to NextCloud

NextCloud is a file storage and sharing system. It can be compared to dropbox or google drive. The difference here is that you’re using your NAS, so you’ll get as much space as you can support without paying for additional storage. NextCloud also offers multi-platform compatibility via a web application and mobile applications.

Although Synology does offer some file storage and sharing solutions, in my experience their software tends to be updated slowly and doesn’t have quite the polished UI that some people want.

NextCloud also offers chat as well as contact and calendar management. If you were planning on removing google from your life, these might be good options as well.

Folder Structure

First off, we’re going to make our docker directory structure. Using SSH or File Station create these directories

/volume1/docker/nextcloud
/volume1/docker/nextcloud/html
/volume1/docker/nextcloud/config
/volume1/docker/nextcloud/themes
/volume1/docker/nextcloud/custom_apps

You also need a place to store your data. You can put this anywhere, but it will be shared across all of your nextcloud users. I’m putting mine under the docker folder structure (for now)

/volume1/docker/nextcloud/data

Create a User

We’ve created users before to support a docker application. We’ll do the same here so that nextcloud user cannot access other aspects of our NAS.

In Control Panel/User click Create. Set a name and password. Check disallow user to change account password. Add them to the users group. Give read/write access to docker share. Don’t set any quotas. Deny access to all applications. Do not set any speed limits.

SSH in and get the id of the user and the user group. Save this for later.

id nextcloud

Setup Docker Compose

SSH into your NAS. Lets create a folder and docker-compose.yaml to define the containers we’ll be creating.

mkdir nextcloud
cd nextcloud
touch docker-compose.yaml

Now use nano (or vi) to add this configuration to the docker-compose.yaml

version: '2.2'
services:
  mariadb:
    container_name: mariadb-nextcloud
    image: mariadb
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
    volumes:
      - mariadb:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${your msql root password}
      - MYSQL_PASSWORD=${your nextcloud user password}
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  nextcloud:
    container_name: nextcloud
    ports:
      - 19000:80
    links:
      - mariadb
    environment:
      - PUID=${your user id}
      - PGID=${your user group id}
      - TZ=${your timezone}
      - NEXTCLOUD_TRUSTED_DOMAINS= nextcloud.bullyrooks.com home.bullyrooks.com
    volumes:
      - /volume1/docker/nextcloud/html:/var/www/html
      - /volume1/docker/nextcloud/custom_apps:/var/www/html/custom_apps
      - /volume1/docker/nextcloud/config:/var/www/html/config
      - /volume1/docker/nextcloud/data:/var/www/html/data
      - /volume1/docker/nextcloud/themes:/var/www/html/themes/
    image: nextcloud
    restart: always

volumes:
  mariadb: # nextcloud

The important parts here is that you’re going to define the mysql root and nextcloud passwords. Additionally, in NEXTCLOUD_TRUSTED_DOMAINS your going to define the reverse proxy domain name. This is important, because if you don’t set this correctly, you won’t be able to login. I’ve also set the external port to 19000, which is important for the reverse proxy. Finally, if you used a different data directory, replace my config with your path.

You can now use docker-compose to get everything up and running

sudo docker-compose up -d

This will take awhile. The database needs to be created and configured and additional files will be unpacked into the directories you created. If you want to track, you can log into portainer, open the nextcloud container and watch the logs as the initialization process is going on.

0 comments on “Setup and Install NextCloud On SynologyAdd yours →

Leave a Reply

Your email address will not be published. Required fields are marked *