{{indexmenu_n>8}}
Note | |
If you don't want to use a dedicated docker disk you can use any disk formatted preferably in EXT4. Avoid mounting docker folders under mergerfs. If you have installed docker on another hard drive you can delete the contents of the /var/lib/docker folder to recover that space on the system drive. This will not affect how docker works. |
Warning | |
Never use an NTFS file system to host docker folders. NTFS is not native to Linux and will cause file permission issues. |
Beginners Note | |
Except for very controlled special cases, never designate the admin user (UID=998) or the root user (UID=0) to manage a container. This is a serious security flaw. If we do this we are giving the container complete freedom to do whatever it wants in our system. Have you created this container? Do you know what he is capable of doing? |
PUID=1000
PGID=100
TZ=Europe/Madrid
SSD=/srv/dev-disk-by-uuid-8a3c0a8f-75bb-47b0-bccb-cec13ca5bb85
DATA=/srv/dev-disk-by-uuid-384444bb-f020-4492-acd2-5997e908f49f
* Now we could define the following compose file:
---
version: "2.1"
services:
jellyfin:
image: lscr.io/linuxserver/jellyfin:latest
container_name: jellyfin
environment:
- PUID=${PUID}
- PGID=${PGID}
- TZ=${TZ}
volumes:
- ${SSD}/app/jellyfin:/config
- ${SSD}/app/jellyfin/cache:/cache
- ${DATA}/media:/media
ports:
- 8096:8096
restart: unless-stopped
* And the file that would actually be executed would be this:
---
version: "2.1"
services:
jellyfin:
image: lscr.io/linuxserver/jellyfin:latest
container_name: jellyfin
environment:
- PUID=1000
- PGID=100
- TZ=Europe/Madrid
volumes:
- /srv/dev-disk-by-uuid-8a3c0a8f-75bb-47b0-bccb-cec13ca5bb85/app/jellyfin:/config
- /srv/dev-disk-by-uuid-8a3c0a8f-75bb-47b0-bccb-cec13ca5bb85/app/jellyfin/cache:/cache
- /srv/dev-disk-by-uuid-384444bb-f020-4492-acd2-5997e908f49f/media:/media
ports:
- 8096:8096
restart: unless-stopped
The advantage of using this system is that we define the compose file once and never need to modify it. Even if we reinstall the OMV system we just need to update those global variables and all our containers will be up to date and continue to work as before.
For paths you could combine this system with symlinks, if you still need to use symlinks for other reasons. If you don't need it you can skip the use of symbolic links, this system is more than enough for handling containers.
\\
Note | |
At this time, the plug-in backup utility does not resolve variables in volume paths. Define paths using global environment variables only for paths that you do not need to include in a backup. Alternatively you can use symlinks in the compose file. |
Note | |
Folders created in the OMV GUI by default have 775 permissions, the owner is root, and the owner group is users. This way the procedure in this guide will work normally. If for some reason this is not the case on your system, make sure that the appuser user has read and write permissions on these folders. If you need to reset the permissions of a folder to the standard OMV permissions you can use the plugin openmediavault-resetperms. |
Warning | |
A symlink like /SSD/docker may not work here, it is preferable to use the full path. Example: /srv/dev-disk-by-uuid-861acf8c-761a-4b60-9123-3aa98d445f72/docker |
PUID=1000
PGID=100
TZ=Europe/Madrid
* Replace the values with the appropriate ones in your case.
* You can see your local configuration in **System** > **Date & Time** in **//Time zone//** field.
* You can see the values of user //appuser// in **Users** > **Users** in the UID and GID columns.
* In this case we don't need it since we have defined the DATA folder in the plugin GUI at **Services**>**Compose**>**Settings**. But if you need to define other different routes you can also do it here in the same way as the rest of the variables.
----
\\
\\
{{ :divider2.png?nolink&800 |}}
===== Example of installing an Application (Jellyfin) =====
----
=== 6. Choose a stack ===
\\
[[https://hub.docker.com/|{{ :omv6:dockeromv7.png?direct&200|}}]]
* On the [[https://hub.docker.com/|dockerhub]] there are thousands of containers ready to configure.
* Try to choose containers from reputable publishers ([[https://www.linuxserver.io/|linuxserver]] is very popular) or with many downloads and current ones.
* Check that the container is compatible with your server's architecture x86-64 arm64...
* When choosing one read the publisher's recommendations before installing it.
* The plugin has examples that you can install directly In the **Services** > **Compose** > **Files** button **//Add from example//**.
[[https://www.linuxserver.io/|{{ :omv6:dockeromv8.png?direct&200|}}]]
* As an example we are going to install [[https://jellyfin.org/|Jellyfin]].
* Many results appear in the search engine, we chose the one for linuxserver [[https://hub.docker.com/r/linuxserver/jellyfin|linuxserver jellyfin]].
* We fetch the docker-compose stack and copy it to a text file. In this case:
\\
\\
[[https://jellyfin.org/|{{ :omv6:dockeromv2.png?200|}}]]
---
version: "2.1"
services:
jellyfin:
image: lscr.io/linuxserver/jellyfin:latest
container_name: jellyfin
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- JELLYFIN_PublishedServerUrl=192.168.0.5 #optional
volumes:
- /path/to/library:/config
- /path/to/tvseries:/data/tvshows
- /path/to/movies:/data/movies
ports:
- 8096:8096
- 8920:8920 #optional
- 7359:7359/udp #optional
- 1900:1900/udp #optional
restart: unless-stopped
Note | |
Verify on the official page that this stack has not changed before installing it |
---
version: "2.1"
services:
jellyfin:
image: lscr.io/linuxserver/jellyfin:latest
container_name: jellyfin
environment:
- PUID=${PUID} # See Comment 1
- PGID=${PGID} # See Comment 1
- TZ=${TZ} # See Comment 2
#- JELLYFIN_PublishedServerUrl=192.168.0.5 # See Comment 3
volumes:
- ./config:/config # See Comment 4
- CHANGE_TO_COMPOSE_DATA_PATH/media:/media # See Comment 4
ports:
- 8096:8096 # See Comment 5
restart: unless-stopped
Note | |
Verify on the official page that this stack has not changed before installing it |
Note | |
Mapping folders means to "mount" the folder inside the container. The container does not "see" what is on our host. Similarly our host does not "see" what is in the container. In order for the container to see a folder on our host, we have to mount it inside the container. This assembly is done in each line of this section. The colon is used as a separator. To the left of the colon we write the actual path of the folder on our host. On the right we tell the container with what name it will "see" that folder when it is running. |
Note | |
When the container writes to /config what will actually happen on the system is that the user appuser will be writing to /appdata/jellyfin/config This is why the appuser user must have permissions to write to the appdata folder, otherwise the container would not work. There is no need to create the /jellyfin folder, docker will do it for us when starting the container. |
Note | |
In the case of jellyfin the libraries are configured from the container, we just need it to be able to see them. That is to say, it is not necessary to map movies on the one hand and photos on the other hand, although we could do it that way too. To make it easier, we map a single volume that contains everything. Later from jellyfin we will search each folder for each library. /media/movies /media/photos etc. |
Beginners Note | |
This file is of type yaml. Indents are important, don't manipulate them while editing. If you do docker won't be able to interpret the file, the container will give an error and won't start. |