Skip to content

Commit

Permalink
feat: Add Plex Docker setup with organized media structure (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
phob authored Feb 8, 2025
2 parents 216cbf8 + 908c357 commit 14705ad
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Plex/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
services:
plex:
container_name: plex
image: plexinc/pms-docker
network_mode: host # Using host network for optimal performance
environment:
- TZ=${TIMEZONE:-$(timedatectl | grep "Time zone" | awk '{print $3}')} # Use system timezone
- PLEX_CLAIM=claim-_C16H5qQ6qhHnubew_Yx
volumes:
- /opt/plex/config:/config
- /opt/plex/transcode:/transcode
- /opt/plex/media:/data
- /mnt/organized/tvseries:/mnt/organized/tvseries
- /mnt/organized/movies:/mnt/organized/movies
- /mnt/zurg/tvseries:/mnt/zurg/tvseries
- /mnt/zurg/movies:/mnt/zurg/movies
restart: unless-stopped

# Note: Before running, ensure directories exist and have correct permissions:
# sudo mkdir -p /opt/plex/{config,transcode,media}
# sudo chown -R $USER:$USER /opt/plex
25 changes: 25 additions & 0 deletions Plex/run-plex.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Create necessary directories if they don't exist
sudo mkdir -p /opt/plex/config
sudo mkdir -p /opt/plex/transcode
sudo mkdir -p /opt/plex/media

# Set permissions
sudo chown -R $USER:$USER /opt/plex

# Get timezone from system
TIMEZONE=$(timedatectl | grep "Time zone" | awk '{print $3}')

# Run Plex Media Server
docker run \
-d \
--name plex \
--network=host \
-e TZ="$TIMEZONE" \
-e PLEX_CLAIM="claim-_C16H5qQ6qhHnubew_Yx" \
-v /opt/plex/config:/config \
-v /opt/plex/transcode:/transcode \
-v /opt/plex/media:/data \
--restart unless-stopped \
plexinc/pms-docker
15 changes: 15 additions & 0 deletions Plex/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Create necessary directories
sudo mkdir -p /opt/plex/{config,transcode,media}
sudo mkdir -p /mnt/organized/{tvseries,movies}
sudo mkdir -p /mnt/zurg/{tvseries,movies}

# Set permissions
sudo chown -R $USER:$USER /opt/plex
sudo chown -R $USER:$USER /mnt/organized
sudo chown -R $USER:$USER /mnt/zurg
# Export timezone for docker-compose
export TIMEZONE=$(timedatectl | grep "Time zone" | awk '{print $3}')

echo "Setup complete! You can now run: docker-compose up -d"

0 comments on commit 14705ad

Please sign in to comment.