selfhosted-apps-docker/jellyfin/readme.md

176 lines
4.3 KiB
Markdown
Raw Permalink Normal View History

2022-01-06 16:29:46 +00:00
# Jellyfin in docker
2021-12-31 00:35:58 +00:00
###### guide-by-example
2022-01-06 16:29:46 +00:00
![logo](https://i.imgur.com/gSyMEvD.png)
2021-12-31 00:35:58 +00:00
# Purpose & Overview
2022-01-06 23:28:43 +00:00
Stream movies/tv-shows/music to a browser, or a [large selection of devices and services.](https://jellyfin.org/clients/)
2021-12-31 00:35:58 +00:00
2022-01-06 16:29:46 +00:00
* [Official site](https://jellyfin.org/)
* [Github](https://github.com/jellyfin/jellyfin)
* [DockerHub](https://hub.docker.com/r/jellyfin/jellyfin/)
2021-12-31 00:35:58 +00:00
2022-01-06 23:28:43 +00:00
Jellyfin if a free media system, an alternative to proprietary Plex.<br>
2022-01-06 16:29:46 +00:00
The core server side is written in C#, web client in Javascript,
and a number of other clients written in various languages and frameworks.
Starting point for me was [this viggy96 repo](https://github.com/viggy96/container_config)
2021-12-31 00:35:58 +00:00
# Files and directory structure
```
2022-01-06 16:29:46 +00:00
/mnt/
└── bigdisk/
├── tv/
├── movies/
└── music/
2021-12-31 00:35:58 +00:00
/home/
└── ~/
└── docker/
2022-01-06 16:29:46 +00:00
└── jellyfin/
2024-02-13 07:14:03 +00:00
├── jellyfin_cache/
├── jellyfin_config/
2022-01-06 16:29:46 +00:00
├── transcodes/
2021-12-31 00:35:58 +00:00
├── .env
2022-11-12 11:51:37 +00:00
└── docker-compose.yml
2021-12-31 00:35:58 +00:00
```
2022-01-06 16:29:46 +00:00
* `/mnt/bigdisk/...` - a mounted media storage share
2024-02-13 07:14:03 +00:00
* `jellyfin_cache/` - cache
* `jellyfin_config/` - configuration
2022-01-06 16:29:46 +00:00
* `transcodes/` - transcoded video storage
2021-12-31 00:35:58 +00:00
* `.env` - a file containing environment variables for docker compose
* `docker-compose.yml` - a docker compose file, telling docker how to run the containers
2022-11-12 11:51:37 +00:00
You only need to provide the two files.</br>
2021-12-31 00:35:58 +00:00
The directories are created by docker compose on the first run.
# docker-compose
2022-01-09 16:06:59 +00:00
The media are mounted in read only mode.
2021-12-31 00:35:58 +00:00
`docker-compose.yml`
```yml
services:
2022-01-06 16:29:46 +00:00
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
hostname: jellyfin
2021-12-31 00:35:58 +00:00
restart: unless-stopped
env_file: .env
2022-01-06 16:29:46 +00:00
devices:
- /dev/dri
2021-12-31 00:35:58 +00:00
volumes:
2022-01-06 16:29:46 +00:00
- ./transcodes/:/transcodes
2024-02-13 07:14:03 +00:00
- ./jellyfin_config:/config
- ./jellyfin_cache:/cache
2022-01-06 16:29:46 +00:00
- /mnt/bigdisk/serialy:/media/video:ro
- /mnt/bigdisk/mp3/moje:/media/music:ro
ports:
2023-05-16 18:07:54 +00:00
- "8096:8096"
2023-06-18 12:31:32 +00:00
- "1900:1900/udp"
2021-12-31 00:35:58 +00:00
networks:
default:
2022-01-06 16:29:46 +00:00
name: $DOCKER_MY_NETWORK
external: true
2021-12-31 00:35:58 +00:00
```
`.env`
```bash
# GENERAL
DOCKER_MY_NETWORK=caddy_net
TZ=Europe/Bratislava
```
**All containers must be on the same network**.</br>
Which is named in the `.env` file.</br>
If one does not exist yet: `docker network create caddy_net`
# Reverse proxy
2022-01-06 23:28:43 +00:00
Caddy is used, details
2021-12-31 00:35:58 +00:00
[here](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/caddy_v2).</br>
`Caddyfile`
```
2022-01-06 16:29:46 +00:00
jellyfin.{$MY_DOMAIN} {
reverse_proxy jellyfin:8096
2021-12-31 00:35:58 +00:00
}
```
# First run
2022-01-09 13:56:51 +00:00
![interface-pic](https://i.imgur.com/pZMi6bb.png)
2021-12-31 00:35:58 +00:00
2022-01-06 16:29:46 +00:00
# Specifics of my setup
2024-02-13 07:14:03 +00:00
* no real long term use
* findroid app does not jump subtitles like official one
2022-11-12 11:54:59 +00:00
* amd cpu and no gpu, so no experience with hw transcoding
2022-01-06 16:29:46 +00:00
* media files are stored and shared on trunas scale VM
2022-01-09 13:56:51 +00:00
and mounted directly on the docker host using [systemd mounts](https://forum.manjaro.org/t/root-tip-systemd-mount-unit-samples/1191),
2022-01-06 16:29:46 +00:00
instead of fstab or autofs.
`/etc/systemd/system/mnt-bigdisk.mount`
```ini
[Unit]
Description=12TB truenas mount
[Mount]
What=//10.0.19.19/Dataset-01
Where=/mnt/bigdisk
Type=cifs
Options=ro,username=ja,password=qq,file_mode=0700,dir_mode=0700,uid=1000
DirectoryMode=0700
[Install]
WantedBy=multi-user.target
```
2022-01-09 16:06:59 +00:00
`/etc/systemd/system/mnt-bigdisk.automount`
2022-01-06 16:29:46 +00:00
```ini
[Unit]
2022-01-09 14:00:05 +00:00
Description=12TB truenas mount
2022-01-06 16:29:46 +00:00
[Automount]
Where=/mnt/bigdisk
[Install]
WantedBy=multi-user.target
```
2022-11-19 23:06:37 +00:00
to automount on boot - `sudo systemctl enable mnt-bigdisk.automount`
2022-01-06 16:29:46 +00:00
2022-02-21 23:02:30 +00:00
# Troubleshooting
![error-pic](https://i.imgur.com/KQhmZTQ.png)
*We're unable to connect to the selected server right now. Please ensure it is running and try again.*
2022-04-03 08:50:12 +00:00
If you encounter this, try opening the url in browsers private window.<br>
2022-02-21 23:02:30 +00:00
If it works then clear the cookies in your browser.
2024-02-13 07:14:03 +00:00
*No playback at all but GUI works fine*
Might be no access to network share, for example if dockerhost boots up faster
than NAS.
2022-02-21 23:02:30 +00:00
2022-01-06 16:29:46 +00:00
# Update
2021-12-31 00:35:58 +00:00
Manual image update:
- `docker-compose pull`</br>
- `docker-compose up -d`</br>
- `docker image prune`
2024-03-28 23:29:18 +00:00
# Useful
2021-12-31 00:35:58 +00:00
2024-03-28 23:29:18 +00:00
* https://www.reddit.com/r/selfhosted/comments/1bit5xr/livetv_on_jellyfin_2024/