What's included in the compose and what is not included
</span>
</a>
@ -3995,7 +3881,16 @@
<p>And a very big thanks to <ahref="https://www.buymeacoffee.com/bokkoman"rel="noopener noreferrer"target="_blank">Bokkoman</a> and <ahref="https://github.com/BaukeZwart"rel="noopener noreferrer"target="_blank">BZwart</a> that updated this Guide for DSM 7 and also offered their help on discord as Synology Support Team.</p>
<p>This page will provide you with guidance on how to install several Docker images to your Synology system. We highly recommend to read the full guide, that way you have a better understanding of what you do, in case you later decide to make changes.</p>
<p>This page will provide you with guidance on how to install several Docker images related to the Servarr apps to your Synology. We highly recommend to read the full guide, that way you have a better understanding of what you do, in case you later decide to make changes.</p>
<summary>Automated script (<strong><imgalt="‼"class="twemoji"src="https://cdn.jsdelivr.net/gh/jdecked/twemoji@15.0.3/assets/svg/203c.svg"title=":bangbang:"/>Use this script at your own risk<imgalt="‼"class="twemoji"src="https://cdn.jsdelivr.net/gh/jdecked/twemoji@15.0.3/assets/svg/203c.svg"title=":bangbang:"/></strong>) - [Click to show/hide]</summary>
<p>You need to install Docker from the <code>Package Center</code>. This should also create a share named <code>docker</code>, check File Station if it is present.</p>
<p>You need to install Docker / Container Manager from the <code>Package Center</code>. This should also create a share named <code>docker</code>, check File Station if it is present.</p>
<h2id="create-the-main-share">Create the main share<aclass="headerlink"href="#create-the-main-share"title="Permanent link"></a></h2>
<divclass="admonition warning">
<pclass="admonition-title">Warning</p>
<p>To get Hardlinks and Atomic-Moves working with your Synology you will need to make use of <strong>ONE</strong> share with subfolders.</p>
</div>
<p>We will use a new share named <code>data</code> (lowercase) for all your library media.</p>
<p>Later in this guide, we will fill this share with subfolders.</p>
<p>We will create and use a new share named <code>data</code> (lowercase) for all your library media and downloads.</p>
<p>Name this shared folder <code>data</code>. You can disable the trash can. Click next until you are done.</p>
<p>Name this shared folder <code>data</code>. You can disable the trash can, up to you. Click next until you are done.</p>
<h2id="create-a-user">Create a user<aclass="headerlink"href="#create-a-user"title="Permanent link"></a></h2>
<p>For this, we are going to create a new user that only has access to the share(s) that we use for this guide.</p>
<p>We are going to create a new user that only has access to the share(s) that we use for the containers to run as. You rather not have the containers run as an admin/root user.</p>
<p>Go to <code>Control Panel</code>><code>User & Group</code></p>
<p>In the <code>User</code> section, create a new user. Name it whatever you like, but for this guide we will use <code>docker</code>.</p>
<p>In the <code>User</code> section, create a new user. Name it whatever you like, but for this guide we will use the name <code>docker</code>.</p>
<p>Fill out the rest of the information, generate a password or type your own.</p>
<p>Click next, you will now be able to select which group this user will belong to, it should only be <code>users</code>. Click <code>Next</code>.</p>
<p>Click next, you will now be able to select which group this user will belong to, it should only be the group <code>users</code>. Click <code>Next</code>.</p>
<p>In this screen you will be able to select which Shares this user will have access to, click <code>No Access</code> on the top, this will deny all access.</p>
<p>Now only select <code>Read/Write</code> on the shares <code>docker</code> and <code>data</code>.</p>
<p>In the next screen you will be able to select which Shares this user will have access to, click <code>No Access</code> on the top, this will deny all access.</p>
<p>Now <strong>only</strong> select <code>Read/Write</code> on the shares <code>docker</code> and <code>data</code> (the share we created earlier).</p>
<p>Then use a program like <ahref="https://www.putty.org/"rel="noopener noreferrer"target="_blank">Putty</a> or Powershell/Terminal to SSH into your Synology.</p>
<p>Enter the login information of a Synology user account that has admin priveliges, as only members of the 'administrators' user group are able to use SSH.</p>
<p>If you get a popup asking if you want to trust the key,
Just press <code>OK</code> or <code>ACCEPT</code></p>
<p>If you get a message asking if you want to trust the key, just press <code>OK</code> or <code>ACCEPT</code>.</p>
<h3id="puid-and-pgid">PUID and PGID<aclass="headerlink"href="#puid-and-pgid"title="Permanent link"></a></h3>
<p>In order for the Docker container to access the shares on the Synology, we need to know the user ID (PUID) and group ID (PGID) from the <code>docker</code> user we just created.</p>
<p>Go into your terminal app, login to your synology ssh.</p>
<p>Once logged in type <code>id $user</code>. Change $user to the newly created username <code>docker</code>.</p>
<p>Once logged in to the terminal type <code>id docker</code>. If you used a different username, change <code>docker</code> to the one you used.</p>
<p>For this example we're going to make use of the share called <code>data</code>.</p>
<p>On the host (Synology) terminal you will need to add <code>/volume1/</code> before it. So <code>/volume1/data</code></p>
<p>The <code>data</code> folder has sub-folders for <code>torrents</code> and <code>usenet</code> and each of these have sub-folders for <code>tv</code>, <code>movie</code> and <code>music</code> downloads to keep things neat. The <code>library</code> folder has nicely named <code>tv</code>, <code>movies</code> and <code>music</code> sub-folders, this is your library and what you’d pass to Plex, Emby or JellyFin.</p>
<p>These subfolders you need to create your self.</p>
<p><em>I'm using lower case on all folder on purpose, being Linux is case sensitive.</em></p>
Which in the screenshot above is <code>1035</code> for the docker user and the GID (aka PGID) which is <code>100</code> for the users group.
<!-- BEGIN INCLUDE ../../../includes/hardlinks/breakdown-folder-structure-synology.md -->
<h3id="breakdown-of-the-folder-structure">Breakdown of the Folder Structure<aclass="headerlink"href="#breakdown-of-the-folder-structure"title="Permanent link"></a></h3>
<p>The reason why we use <code>/data/torrents</code> for the torrent client is because it only needs access to the torrent files. In the torrent software settings, you’ll need to reconfigure paths and you can sort into sub-folders like <code>/data/torrents/{tv|movies|music}</code>.</p>
<p>The reason why we use <code>/data/usenet</code> for the usenet client is because it only needs access to the usenet files. In the usenet software settings, you’ll need to reconfigure paths and you can sort into sub-folders like <code>/data/usenet/complete/{tv|movies|music}</code>.</p>
<p>Sonarr, Radarr, Readarr and Lidarr gets access to everything using <code>/data</code> because the download folder(s) and media folder will look like and be one file system. Hardlinks will work and moves will be atomic, instead of copy + delete.</p>
<p>Plex, Emby, JellyFin and Bazarr only needs access to your media library using <code>/data/media</code>, which can have any number of sub folders like Movies, Kids Movies, TV, Documentary TV and/or Music as sub folders.</p>
<p>Your appdata will be stored in <code>/volume1/docker/appdata/{appname}</code>
These <code>{appname}</code> sub folders you need to create your self. (<em>This is a limitation of the Synology</em>)
We're going to do this in Putty or a similar program.</p>
<p>Your application data will be stored in the <code>docker</code> share in the folder called <code>appdata</code> (<code>/volume1/docker/appdata</code>)
Create these folders with command below, or create them in File Station manually.</p>
@ -4227,22 +4021,18 @@ We're going to do this in Putty or a similar program.</p>
<p>Download this <ahref="https://raw.githubusercontent.com/TRaSH-/Guides-Synology-Templates/main/docker-compose/docker-compose.yml"rel="noopener noreferrer"target="_blank">docker-compose.yml</a> to your <code>/volume1/docker/appdata</code> location so you got your important stuff together. Or use the command below:</p>
<h3id="whats-included-and-whats-not-included">Whats included and Whats not included<aclass="headerlink"href="#whats-included-and-whats-not-included"title="Permanent link"></a></h3>
<detailsclass="question">
<summary>What's included and What's not included - [Click to show/hide]</summary>
<h3id="whats-included-in-the-compose-and-what-is-not-included">What's included in the compose and what is not included<aclass="headerlink"href="#whats-included-in-the-compose-and-what-is-not-included"title="Permanent link"></a></h3>
<p>This docker-compose file will have the following docker containers included.</p>
<ul>
<li>Radarr</li>
<li>Sonarr</li>
<li>Bazarr (Subtitle searcher and downloader)</li>
<p>What's not included (and where are the download clients?).</p>
<p>I didn't add a download client to it, because it depends on what you prefer (usenet/torrent) and which client you prefer, so I created a new <ahref="https://github.com/TRaSH-/Guides-Synology-Templates/tree/main/templates"rel="noopener noreferrer"target="_blank">Repository</a> on Github where I provide and maintain some templates that are ready to use with the main <code>docker-compose.yml</code>.</p>
<p>The only thing you need to do is copy/paste what's inside the <code>.yml</code> file in to the main <code>docker-compose.yml</code>, the template also has the command what you need to use to create the <ahref="#appdata">appdata</a> folder that we explained earlier.</p>
</details>
<p>We didn't add a download client to it, because it depends on what you prefer (usenet/torrent) and which client you prefer. We have a repository <ahref="https://github.com/TRaSH-/Guides-Synology-Templates/tree/main/templates"rel="noopener noreferrer"target="_blank">Repository</a> on Github where we provide and maintain some templates that are ready to use with the main <code>docker-compose.yml</code>.</p>
<p>The only thing you need to do is copy & paste what's inside the template file into to the main <code>docker-compose.yml</code> on the bottom, the templates also have a command what you need to use to create the <ahref="#appdata">appdata</a> folder that we explained earlier. Without the appdata folder for the application, the creation of the container will fail because of the missing folder.</p>
<p>Second we will download the <code>.env</code> file</p>
<p>Download this <ahref="https://raw.githubusercontent.com/TRaSH-/Guides-Synology-Templates/main/docker-compose/.env"rel="noopener noreferrer"target="_blank">.env</a> to your <code>/volume1/docker/appdata</code> location so you got your important stuff together. Or use this command:</p>
<p>Download this <ahref="https://raw.githubusercontent.com/TRaSH-/Guides-Synology-Templates/main/docker-compose/.env"rel="noopener noreferrer"target="_blank">.env</a> to your <code>/volume1/docker/appdata</code> location next to the <code>docker-compose.yml</code>. Or use this command:</p>
@ -4268,16 +4058,16 @@ We're going to do this in Putty or a similar program.</p>
</div>
<hr/>
<h4id="pullio-auto-update-docker-compose-the-correct-way">Pullio - Auto update docker-compose the correct way<aclass="headerlink"href="#pullio-auto-update-docker-compose-the-correct-way"title="Permanent link"></a></h4>
<p>Pullio allows you to automatically update your containers. And send you a notification through various means. In my setup, I use a Discord Webhook.</p>
<p>Pullio allows you to automatically update your containers. And send you a notification through various means. We use a Discord Webhook.</p>
<p>For Pullio to work, you will need to create in your Task Scheduler a "Scheduled Task" that runs for example at 4am at night with root privileges.</p>
<p>For Pullio to do it's job, you will need to create a Scheduled Task in your Task Scheduler that runs for example at 4am at night with <strong>root</strong> privileges.</p>
<p><code>Control Panel</code>><code>Task Scheduler</code>> click <code>Create</code>> choose <code>Scheduled task - user defined script</code></p>
<p>Give the task a name so you know what it does. Choose user <code>root</code>.</p>
<p>In the <code>Schedule</code> tab choose whenever you want it to check for updates.</p>
<p>In the <code>Schedule</code> tab choose when and how often you want it to check for updates.</p>
<p>At <code>Task Settings</code> tab, add the following line in the Run Command section:</p>
<p>Now we need to make sure that the newly created files and folders have the correct permissions.</p>
<p>If you have an existing library, it is advised to move these to the new <code>data</code> share prior to running the commands below.</p>
<divclass="admonition note">
<pclass="admonition-title">Note</p>
<p>If you're using a different user than <code>docker</code> (the user generated in the beginning), then you need to change the <code>docker:users</code> part in the commands below!!!</p>
<p>If you're using a different user than <code>docker</code> (the user generated in the beginning), then you need to change the <code>docker:users</code> part in the command below!!!</p>
@ -4296,26 +4087,26 @@ We're going to do this in Putty or a similar program.</p>
</code></pre></div>
<divclass="admonition note">
<pclass="admonition-title">Note</p>
<p>If you copy files from a different library into the newly created library, you need to rerun these commands. !!!</p>
<p>If you move files from a different library into the newly created library afterwards, you need to rerun these commands. !!!</p>
</div>
<hr/>
<h2id="run-the-docker-compose">Run the Docker Compose<aclass="headerlink"href="#run-the-docker-compose"title="Permanent link"></a></h2>
<divclass="admonition tip">
<pclass="admonition-title">Tip</p>
<p>make sure you delete/remove all your existing dockers from the Docker GUI and also remove your native installs (in Package Center) of these applications !!!
If you had previous installed apps, make a backup of their config folders.</p>
If you had previous installed apps, make a backup of their config folders or backup through the webui of the app.</p>
</div>
<p>When you did all the above steps you only need to run the following commands:</p>
<p>If you have followed all the steps and your compose file is ready, run the following commands:</p>
<p>You will notice that all the images will be downloaded, after that the containers will be started. If you get a error then look at the error what it says and try to fix it. If you still got issues then put your used docker-compose.yml on <ahref="https://0bin.net/"rel="noopener noreferrer"target="_blank">0bin</a> and join the guides-discord <ahref="https://trash-guides.info/discord"rel="noopener noreferrer"target="_blank">here</a> and provide the pastebin link with the error, have patience because of timezone differences.</p>
<p>You will notice that all the images will be downloaded, after that the containers will be started. If you get a error then read what error says and try to fix it (missing folders, permissions errors, etc). If you can't figure out the solution to your errors, join the guides-discord <ahref="https://trash-guides.info/discord"rel="noopener noreferrer"target="_blank">here</a> and create a support ticket.</p>
<hr/>
<p><strong>Don't forget to look at the <ahref="/Hardlinks/Examples/">Examples</a> how to setup the paths inside your applications.</strong></p>
<p><strong>If you need help setting up the applications, look at the <ahref="/Hardlinks/Examples/">Examples</a> how to setup the paths inside your applications.</strong></p>
<divclass="admonition warning">
<pclass="admonition-title">Warning</p>
<p>If you need to do any changes, only edit the <code>docker-compose.yml</code> file. To activate the changes, run the command <code>sudo docker-compose up -d</code> again, from within the <code>/volume1/docker/appdata</code> folder.</p>
<p>If you need to do any changes, only edit the <code>docker-compose.yml</code> file. To activate the changes, <ahref="#run-the-docker-compose">run the commands from here</a>) again.</p>
<p>Any changes you do/did in the GUI will be reverted when you run the docker-compose command.</p>
<p>Just don't use the GUI, only for information purposes !!!</p>
</div>
@ -4403,7 +4194,7 @@ If you had previous installed apps, make a backup of their config folders.</p>