Skip to content

Commit db37add

Browse files
authored
fix(tuto): update tutorial (#4323)
1 parent a7970fa commit db37add

File tree

1 file changed

+58
-109
lines changed

1 file changed

+58
-109
lines changed

tutorials/configure-plex-s3/index.mdx

Lines changed: 58 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -11,163 +11,112 @@ categories:
1111
- object-storage
1212
- instances
1313
dates:
14-
validation: 2024-11-04
14+
validation: 2025-01-30
1515
posted: 2018-09-24
1616
---
1717

1818
Plex is a client/server media player system comprising two main components:
1919

20-
- The **Plex Server** application, which is available for Windows, macOS, Linux, and even including some NAS devices.
20+
- The **Plex Server** application, which is available for Windows, macOS, Linux, and even some NAS devices.
2121
- **Plex clients** that can be either a web-based interface, an application on smart TVs, streaming boxes, or other third-party applications.
2222

2323
<Macro id="requirements" />
2424

2525
- A Scaleway account logged into the [console](https://console.scaleway.com)
2626
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
2727
- An [SSH key](/organizations-and-projects/how-to/create-ssh-key/)
28-
- An [Instance](/instances/how-to/create-an-instance/) running Ubuntu Focal Fossa (20.04 LTS)
28+
- An [Instance](/instances/how-to/create-an-instance/) running Ubuntu 22.04 LTS (or later)
2929
- An [Object Storage bucket](/object-storage/how-to/create-a-bucket/)
3030
- `sudo` privileges or access to the root user
3131

3232
## Installing the required software
3333

34-
1. Connect to your Instance using SSH.
35-
```
34+
1. Connect to your Instance using SSH:
35+
```bash
3636
ssh root@<your-instance-IP>
3737
```
3838
2. Update the APT package manager and the software already installed on the system:
39-
```
39+
```bash
4040
apt update && apt upgrade -y
4141
```
4242
3. Add the Plex repository:
4343

44-
Add Plex's GPG key to the apt sources keychain and create a new file containing an entry to the Plex repository by running the following commands:
45-
```
46-
curl https://downloads.plex.tv/plex-keys/PlexSign.key | apt-key add -
47-
echo deb https://downloads.plex.tv/repo/deb public main | tee /etc/apt/sources.list.d/plexmediaserver.list
44+
Add Plex's GPG key and create a new repository file:
45+
```bash
46+
sudo mkdir -p /etc/apt/keyrings
47+
curl -fsSL https://downloads.plex.tv/plex-keys/PlexSign.key | sudo gpg --dearmor -o /etc/apt/keyrings/plex.gpg
48+
echo "deb [signed-by=/etc/apt/keyrings/plex.gpg] https://downloads.plex.tv/repo/deb public main" | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
4849
```
4950
4. Install Plex and s3fs:
5051

51-
Now, as the Plex repository is enabled, update the APT package list and install the latest version of Plex and s3fs, which is needed to mount the Object Storage bucket.
52-
```
52+
Update the APT package list and install the latest version of Plex and s3fs:
53+
```bash
5354
apt update
5455
apt install -y plexmediaserver s3fs
5556
```
5657

5758
### Configuring s3fs
5859

59-
1. Create the folder on which you will mount the bucket.
60-
```
60+
1. Create the folder on which you will mount the bucket:
61+
```bash
6162
mkdir -p /mnt/media
6263
```
63-
2. Enter your API keys in the password file and set owner-only permissions.
64-
```
65-
echo $ACCESS_KEY:$SECRET_KEY > ~/.passwd-s3fs
66-
chmod 600 ~/.passwd-s3fs
67-
```
68-
3. Uncomment `user_allow_other` in the `/etc/fuse.conf` file to allow other users to access the server. You can use a text editor of your choice. In this tutorial we use `nano`.
64+
2. Obtain and configure API keys for Scaleway Object Storage:
65+
66+
- Log in to your [Scaleway console](https://console.scaleway.com) and navigate to Object Storage.
67+
- Select or create a bucket.
68+
- [Create an API](/iam/how-to/create-api-keys/) key with `ObjectStorageFullAccess` permission.
69+
70+
3. Enter your API keys in the password file and set proper permissions:
71+
```bash
72+
echo ACCESS_KEY_ID:SECRET_ACCESS_KEY | sudo tee /etc/passwd-s3fs
73+
sudo chmod 600 /etc/passwd-s3fs
6974
```
70-
nano /etc/fuse.conf
75+
4. Uncomment `user_allow_other` in the `/etc/fuse.conf` file:
76+
```bash
77+
sudo nano /etc/fuse.conf
7178
[...]
7279
user_allow_other
7380
```
74-
4. Mount the bucket in the local file system.
75-
```
76-
s3fs plexmediaserver /mnt/media -o allow_other -o umask=0002 -o passwd_file=${HOME}/.passwd-s3fs -o url=https://s3.nl-ams.scw.cloud
81+
5. Mount the bucket in the local file system:
82+
```bash
83+
sudo s3fs BUCKET_NAME /mnt/media -o allow_other -o umask=0002 -o passwd_file=/etc/passwd-s3fs -o url=https://s3.REGION.scw.cloud
7784
```
7885
<Message type="note">
79-
Replace `plexmediaserver` with the name of your bucket and `nl-ams` with the region of your bucket, if necessary.
86+
Replace `BUCKET_NAME` with the name of your bucket and `REGION` with its appropriate code (e.g., `nl-ams`).
8087
</Message>
81-
5. (Optional) To mount the bucket automatically during boot, create a [systemd](/tutorials/systemd-essentials/) script, called `/etc/systemd/user/s3fs.service`:
82-
```
83-
[Unit]
84-
Description=S3FS mounts
85-
Wants=network-online.target
86-
After=network-online.target
87-
88-
[Service]
89-
Type=oneshot
90-
RemainAfterExit=yes
91-
ExecStart=/usr/bin/s3fs plexmediaserver /mnt/media -o allow_other -o umask=0002 -o passwd_file=${HOME}/.passwd-s3fs -o url=https://s3.nl-ams.scw.cloud
92-
ExecStop=/bin/fusermount -u /mnt/media
93-
94-
[Install]
95-
WantedBy=default.target
96-
```
97-
6. Enable the script by running the following commands:
98-
```
99-
systemctl --user enable s3fs.service
100-
systemctl --user start s3fs.service
101-
```
102-
103-
If you ever want to disable the automatic mounting, run the following command:
104-
105-
```
106-
systemctl --user stop s3fs.service
88+
6. (Optional) Enable automatic mounting at boot by adding an entry to `/etc/fstab`:
89+
```bash
90+
echo "s3fs#BUCKET_NAME /mnt/media fuse _netdev,allow_other,umask=0002,passwd_file=/etc/passwd-s3fs,url=https://s3.REGION.scw.cloud 0 0" | sudo tee -a /etc/fstab
10791
```
10892

10993
### Configuring Plex
11094

111-
1. Check that Plex is running before continuing:
112-
```
95+
1. Check that Plex is running:
96+
```bash
11397
systemctl status plexmediaserver.service
11498
```
115-
116-
The output should look like this example:
117-
118-
```
119-
● plexmediaserver.service - Plex Media Server for Linux
120-
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor
121-
Active: active (running) since Sun 2018-09-23 14:16:52 UTC; 1min 53s ago
122-
Process: 882 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APP
123-
Main PID: 889 (sh)
124-
[...]
125-
```
126-
127-
If the status is `active (running)` everything is fine.
99+
If the status is `active (running)`, everything is fine.
128100
2. Access the Plex interface through an SSH tunnel:
129-
- On Linux or macOS computers, you can create the tunnel with the following command:
130-
```
131-
ssh [email protected] -L 8888:localhost:32400
132-
```
133-
- On Windows computers, you can create the tunnel by using [PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/):
134-
- Open PuTTY, and enter your server IP address in the hostname and SSH port. Or, if you already have your server session set up and saved, just load the existing session.
135-
- Go to **Connection** > **SSH** > **Tunnels**.
136-
- Fill in **Source port** as **8888** and **Destination** as **localhost:32400**.
137-
- Click the **Add** button.
138-
- Navigate back to the session homepage now and click the **Save** button, then **Open** to connect to the server.
139-
140-
Open a web browser on your local computer and navigate to `http://localhost:8888/web`. The Plex login screen displays:
141-
<Lightbox src="scaleway-plex-login.webp" alt="" />
142-
101+
- On Linux/macOS:
102+
```bash
103+
ssh [email protected] -L 8888:localhost:32400
104+
```
105+
- On Windows (using PuTTY):
106+
- Open PuTTY, enter your server IP, and navigate to **Connection > SSH > Tunnels**.
107+
- Set **Source port** to `8888` and **Destination** to `localhost:32400`.
108+
- Click **Add**, then **Save**, then **Open** to connect.
109+
110+
Open a browser and go to `http://localhost:8888/web` to access Plex.
143111
<Message type="note">
144-
In order to use Plex, you must create an account.
145-
</Message>
146-
147-
Once you are logged in, you will be automatically redirected to the setup of the server:
148-
149-
<Lightbox src="scaleway-plex-server-setup.webp" alt="" />
150-
3. Access the Plex interface with your server IP address:
151-
- Open a web browser on your local computer and navigate to `http://<plex.server.ip>:32400`
152-
- The Plex login screen should display.
153-
154-
<Message type="note">
155-
The port `32400` is the default used by Plex for the interface.
156-
</Message>
157-
4. Enter the required parameters and click **Next** to complete the setup.
158-
<Message type="note">
159-
Make sure the checkbox `Allow me to access my media outside my home` is ticked, so you can access your media files from any device.
160-
</Message>
161-
5. Click **Add a library** to create a new media gallery.
162-
6. Select the type of library you wish to create and click **Next**.
163-
7. Click **Browse and select a multimedia folder** to do so.
164-
- Plex recommends creating separate folders for each type of media. For example, if your library is about movies, create a folder `Movies` in your bucket, through the `/mnt/media` mounted folder or the Scaleway console.
165-
- You should see the `Movies` folder inside Plex, in the browse window.
166-
8. Select `/mnt/media/<Folder name>` as the media folder.
167-
<Lightbox src="scaleway-plex-add-folder.webp" alt="" />
168-
169-
<Message type="tip">
170-
You can upload additional content to your server with any Amazon S3-compatible tool, like [Cyberduck](/tutorials/store-s3-cyberduck/).
112+
A Plex account is required.
171113
</Message>
172-
9. Click **Next** and then **Finish** to conclude the set-up.
173-
10. Add media to your bucket and trigger a scan of your media folder in the Plex interface. Your media should display. If so, it is all set up. For more information about Plex, refer to their [official documentation](https://support.plex.tv/articles/).
114+
3. Configure the Plex server:
115+
- Open `http://<plex.server.ip>:32400` in a browser.
116+
- Complete the setup wizard.
117+
- Add a library and specify `/mnt/media/<Folder Name>` as the media folder.
118+
<Lightbox src="scaleway-plex-add-folder.webp" alt="Adding a media folder in Plex" />
119+
4. To upload media, use an S3-compatible tool like Cyberduck.
120+
5. Trigger a media scan in Plex to display new files.
121+
122+
For more information, refer to [Plex's official documentation](https://support.plex.tv/articles/).

0 commit comments

Comments
 (0)