{"id":1001,"date":"2021-02-21T10:19:54","date_gmt":"2021-02-21T17:19:54","guid":{"rendered":"http:\/\/bullyrooks.com\/?p=1001"},"modified":"2021-02-21T10:19:54","modified_gmt":"2021-02-21T17:19:54","slug":"setup-and-install-nextcloud-on-synology","status":"publish","type":"post","link":"https:\/\/bullyrooks.com\/index.php\/2021\/02\/21\/setup-and-install-nextcloud-on-synology\/","title":{"rendered":"Setup and Install NextCloud On Synology"},"content":{"rendered":"\n<p>NextCloud is a file storage and sharing system.  It can be compared to dropbox or google drive.  The difference here is that you&#8217;re using your NAS, so you&#8217;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.<\/p>\n\n\n\n<p>Although Synology does offer some file storage and sharing solutions, in my experience their software tends to be updated slowly and doesn&#8217;t have quite the polished UI that some people want.  <\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Folder Structure<\/h2>\n\n\n\n<p>First off, we&#8217;re going to make our docker directory structure.  Using SSH or File Station create these directories<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/volume1\/docker\/nextcloud\n\/volume1\/docker\/nextcloud\/html\n\/volume1\/docker\/nextcloud\/config\r\n\/volume1\/docker\/nextcloud\/themes\r\n\/volume1\/docker\/nextcloud\/custom_apps<\/code><\/pre>\n\n\n\n<p>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&#8217;m putting mine under the docker folder structure (for now)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/volume1\/docker\/nextcloud\/data<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Create a User<\/h2>\n\n\n\n<p>We&#8217;ve created users before to support a docker application.  We&#8217;ll do the same here so that nextcloud user cannot access other aspects of our NAS.<\/p>\n\n\n\n<p>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&#8217;t set any quotas.  Deny access to all applications.  Do not set any speed limits.<\/p>\n\n\n\n<p>SSH in and get the id of the user and the user group.  Save this for later.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>id nextcloud<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Setup Docker Compose<\/h2>\n\n\n\n<p>SSH into your NAS.  Lets create a folder and docker-compose.yaml to define the containers we&#8217;ll be creating.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir nextcloud\ncd nextcloud\ntouch docker-compose.yaml<\/code><\/pre>\n\n\n\n<p>Now use nano (or vi) to add this configuration to the docker-compose.yaml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>version: '2.2'\r\nservices:\r\n  mariadb:\r\n    container_name: mariadb-nextcloud\r\n    image: mariadb\r\n    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW\r\n    restart: always\r\n    volumes:\r\n      - mariadb:\/var\/lib\/mysql\r\n    environment:\r\n      - MYSQL_ROOT_PASSWORD=${your msql root password}\r\n      - MYSQL_PASSWORD=${your nextcloud user password}\r\n      - MYSQL_DATABASE=nextcloud\r\n      - MYSQL_USER=nextcloud\n\r\n  nextcloud:\r\n    container_name: nextcloud\r\n    ports:\r\n      - 19000:80\r\n    links:\r\n      - mariadb\r\n    environment:\r\n      - PUID=${your user id}\n      - PGID=${your user group id}\n      - TZ=${your timezone}\r\n      - NEXTCLOUD_TRUSTED_DOMAINS= nextcloud.bullyrooks.com home.bullyrooks.com\r\n    volumes:\r\n      - \/volume1\/docker\/nextcloud\/html:\/var\/www\/html\r\n      - \/volume1\/docker\/nextcloud\/custom_apps:\/var\/www\/html\/custom_apps\r\n      - \/volume1\/docker\/nextcloud\/config:\/var\/www\/html\/config\r\n      - \/volume1\/docker\/nextcloud\/data:\/var\/www\/html\/data\r\n      - \/volume1\/docker\/nextcloud\/themes:\/var\/www\/html\/themes\/\r\n    image: nextcloud\r\n    restart: always\r\n\r\nvolumes:\r\n  mariadb: # nextcloud<\/code><\/pre>\n\n\n\n<p>The important parts here is that you&#8217;re going to <strong>define<\/strong> 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&#8217;t set this correctly, you won&#8217;t be able to login.  I&#8217;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.<\/p>\n\n\n\n<p>You can now use docker-compose to get everything up and running<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo docker-compose up -d<\/code><\/pre>\n\n\n\n<p>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.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"entry-summary\">\nNextCloud is a file storage and sharing system. It can be compared&hellip;\n<\/div>\n<div class=\"link-more\"><a href=\"https:\/\/bullyrooks.com\/index.php\/2021\/02\/21\/setup-and-install-nextcloud-on-synology\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &ldquo;Setup and Install NextCloud On Synology&rdquo;<\/span>&hellip;<\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,36],"tags":[26,131,6],"course":[130],"class_list":["post-1001","post","type-post","status-publish","format-standard","hentry","category-home-networking","category-synology","tag-docker-compose","tag-nextcloud","tag-synology","course-synology-next-cloud","entry"],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":1007,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/02\/21\/login-to-nextcloud\/","url_meta":{"origin":1001,"position":0},"title":"Login to NextCloud","author":"Bullyrook","date":"February 21, 2021","format":false,"excerpt":"Finally, we'll want to login and do the final setup. Go to your nextcloud url (https:\/\/nexcloud.your_domain.com). You'll be presented with an admin account creation screen. Create the first user\/admin. You can turn off additional nextcloud features here, but for now, leave them on. Click on files in the top left\u2026","rel":"","context":"In &quot;Home Networking&quot;","block_context":{"text":"Home Networking","link":"https:\/\/bullyrooks.com\/index.php\/category\/technology\/home-networking\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/02\/image-65.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1003,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/02\/21\/nextcloud-configuration\/","url_meta":{"origin":1001,"position":1},"title":"NextCloud Configuration","author":"Bullyrook","date":"February 21, 2021","format":false,"excerpt":"We'll need to do a few things before we can actually start using nextcloud. Edit config.php First stop the nextcloud containers (from the \/nextcloud directory) sudo docker-compose down Now change to the nextcloud configuration directory cd \/volume1\/docker\/nextcloud\/config\/ and use nano (or vi) to edit the config.php file sudo nano config.php\u2026","rel":"","context":"In &quot;Home Networking&quot;","block_context":{"text":"Home Networking","link":"https:\/\/bullyrooks.com\/index.php\/category\/technology\/home-networking\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/02\/image-62.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":549,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/01\/25\/installing-portainer-in-docker-on-synology\/","url_meta":{"origin":1001,"position":2},"title":"Installing Portainer in Docker on Synology","author":"Bullyrook","date":"January 25, 2021","format":false,"excerpt":"Although we can install and run docker containers directly in the synology docker package, I recommend installing portainer as a docker management tool. Portainer has a nice web based user interface, which means that you can access it directly via the browser instead of logging into the synology DSM and\u2026","rel":"","context":"In &quot;Home Networking&quot;","block_context":{"text":"Home Networking","link":"https:\/\/bullyrooks.com\/index.php\/category\/technology\/home-networking\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/Screen-Shot-2021-01-23-at-6.00.11-PM.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":643,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/01\/27\/prepare-synology-for-media-components\/","url_meta":{"origin":1001,"position":3},"title":"Prepare Synology for Media Components","author":"Bullyrook","date":"January 27, 2021","format":false,"excerpt":"We'll need to do a little setup on Synology first in order to create the appropriate user account and directory structure. Create the Media Components User Account Get into the DSM on the NAS. Open Control Panel and select User Create a new user that docker will run your media\u2026","rel":"","context":"In &quot;Home Networking&quot;","block_context":{"text":"Home Networking","link":"https:\/\/bullyrooks.com\/index.php\/category\/technology\/home-networking\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-39.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":543,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/01\/25\/installing-docker-on-synology-dsm\/","url_meta":{"origin":1001,"position":4},"title":"Installing Docker on Synology DSM","author":"Bullyrook","date":"January 25, 2021","format":false,"excerpt":"Docker is a very useful tool that will allow us to quickly expand the usefulness of our NAS. It has very similar functionality to the Package Center. However, docker runs its applications inside virtual machines and not directly on the NAS hardware. This means that the applications are self contained\u2026","rel":"","context":"In &quot;Home Networking&quot;","block_context":{"text":"Home Networking","link":"https:\/\/bullyrooks.com\/index.php\/category\/technology\/home-networking\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/Screen-Shot-2021-01-23-at-5.47.13-PM.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/Screen-Shot-2021-01-23-at-5.47.13-PM.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/Screen-Shot-2021-01-23-at-5.47.13-PM.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":627,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/01\/25\/why-use-docker-on-synology\/","url_meta":{"origin":1001,"position":5},"title":"Why Use Docker on Synology?","author":"Bullyrook","date":"January 25, 2021","format":false,"excerpt":"There's lots of reasons why docker is a good fit for your synology server. Among them are Better maintained applications. Some synology packages are not maintained very well.Better supported applications. Documentation for docker images is usually very good.Isolation from the underlying OS. You don't need to worry about dependency versioning\u2026","rel":"","context":"In &quot;Home Networking&quot;","block_context":{"text":"Home Networking","link":"https:\/\/bullyrooks.com\/index.php\/category\/technology\/home-networking\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-31.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/1001","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/comments?post=1001"}],"version-history":[{"count":1,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/1001\/revisions"}],"predecessor-version":[{"id":1002,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/1001\/revisions\/1002"}],"wp:attachment":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/media?parent=1001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/categories?post=1001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/tags?post=1001"},{"taxonomy":"course","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/course?post=1001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}