aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 148947e3ef7d909d54018577d72d4a7e48affc3e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Plex Server Setup

This repository contains scripts and configuration for setting up a Plex Media
Server. I run this on a Raspberry Pi 4B running Debian.

## Assumptions

- Server running Debian (e.g. apt-based)
- External storage device with UUID `2c882f17-50e7-4099-a305-693f4aa0113b`
  - Comment out `ensure_fstab_entry` if you're not using a separate external
    hard drive for your media or change the UUID as needed. If you comment it
    out, we'll want to adjust the Plex data directory from `/mnt/media/Plex` to
    wherever your data will be.
- Plex account and claim token

## Installation

1. Copy the files over to your server:
```sh
scp compose.yaml <username>@<server>:/home/<username>/compose.yaml
scp setup-plex.sh <username>@<server>:/home/<username>/setup-plex.sh
```

2. SSH into your server:
```sh
ssh <username>@<server>
```

3. Set the plex claim token (get a claim token at https://www.plex.tv/claim/):
```sh
sed 's|PLEX_CLAIM=<your-plex-claim-token>|PLEX_CLAIM=your-actual-token-here|' compose.yaml > compose.yaml.tmp \
  && mv compose.yaml.tmp compose.yaml
```

4. Additionally, the timezone is hard-coded to 'America/New_York'. If that's not
your timezone, adjust it in the `compose.yaml` file:
```sh
sed 's|TZ=America/New_York|TZ=your-timezone-here|' compose.yaml > compose.yaml.tmp \
  && mv compose.yaml.tmp compose.yaml
```

5. Run the installation script to set up an fstab entry for a external hard drive
and install docker:

```sh
chmod +x setup-plex.sh
sudo ./setup-plex.sh
```

6. After the fstab entry is added, ensure the drive is mounted for the external
hard drive:
```sh
sudo mount -a
```

7. Now, finally, we can start plex:
```bash
docker compose up --detach
```

## Configuration

### Volume Mappings

- `/mnt/media/Plex` - Media files on an external drive
- `/opt/plex-config` - Plex configuration and metadata on the server drive
- `/opt/plex-transcode` - Temporary transcoding files on the server drive

### Ports

Plex uses multiple ports for different features. All necessary ports are exposed
in the compose file.