Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

https://jellyfin.org/docs/general/administration/installing.html

WD=/opt/jellyfin
mkdir -p $WD/{setup,conf,cache}
cd $WD/setup
cat << 'EOF' >docker-compose.yaml
version: '3.7'

services:
 jellyfin:
    container_name: jellyfin
    image: jellyfin/jellyfin
    hostname: jellyfin
    network_mode: host
    volumes:
      - type: bind
        source: /opt/jellyfin/conf/
        target: /config
      - type: bind
        source: /opt/jellyfin/conf/
        target: /cache
    environment:
      - 'TZ=${TZ}'
      - 'JELLYFIN_PublishedServerUrl=${JELLYFIN_PublishedServerUrl}'

EOF
chmod +x docker-compose.yaml
cd $WD/setup
cat << 'EOF'>.env
TZ=America/Whitehorse
JELLYFIN_PublishedServerUrl=
EOF
chmod +x .env
WD=/opt/jellyfin/setup
cat << EOF >$WD/jellyfin.service.setup.sh
cat << EOL >/lib/systemd/system/jellyfin.service
[Unit]
Description=jellyfin_Docker
Requires=docker.service network-online.target

[Service]

Restart=on-abnormal
ExecStart=/usr/bin/docker-compose --project-name jellyfin --project-directory $WD -f $WD/docker-compose.yaml up
ExecStop=/usr/bin/docker-compose --project-name jellyfin --project-directory $WD -f $WD/docker-compose.yaml stop

[Install]
WantedBy=multi-user.target
EOL
systemctl enable jellyfin
systemctl restart jellyfin
systemctl status jellyfin
EOF
chmod +x $WD/jellyfin.service.setup.sh
$WD/jellyfin.service.setup.sh
echo 'alias jfincli="docker exec -it jellyfin /bin/bash"' >> ~/.bashrc
source ~/.bashrc
  • No labels