Why are you writing this tutorial?
This is not a discussion regarding the technicalities and politics of Plex Development.
For those of us who’ve uploaded our media libraries to ACD, it’s come as a bit of a surprise that Plex may not end up supporting ACD as a storage provider for their upcoming Plex Cloud.
My library is mostly uploaded to ACD, and was ready for use with Plex. Unfortunately, I cant afford Google Drive, nor can I afford Microsoft OneDrive in the capacities I’d require.
The other thing I’m not looking forward to, is having to re-upload my data again. I know there are methods to move the data directly, but the information about them is sketchy or require a middle man. Some even require a subscription.
Needless to say, this doesn’t sit well with me.
At the very least, this is a stop gap, or temporary solution to be able to access and play my media.
There are a lot of ‘almost’ tutorials out there, that provide most of the information to connect everything together, the problem is they aren’t really complete, with missing steps and generalities.
Tutorial Goals
- Automatically run PMS
- Automatically mount your ACD as a usable FUSE drive
- Be able to access the PMS Web Interface and view media remotely
Prerequisites
- An ACD account, where you have your media
- A VPS (Virtual Private Server) or Bare Metal Server that has at least 4x Cores for transcoding (enough for 720p)
- Ubuntu 16.04 Server installed and running
- Access to your VPS via SSH
- Enough bandwidth on your VPS for large amounts of media
- Around 150Gb of free disk space to allow for Transcoding and Library data (depending on library/media size)
Assumptions
- That your media is housed on ACD within the standard Plex Folder Structure
- That you have a basic understanding of Linux/Ubuntu, and how to secure your own server
- That you’re using PuTTY as your SSH client, and are familiar with how it (the application) works
Known Issues
- Writing to the ACD FUSE drive is very unstable - This is an upstream issue
- Reading directly from ACD relies heavily on your incoming bandwidth to the VPS
- PMS will not automatically detect changes to ACD/Libraries, manual or scheduled updates will be required
- Viewing media will require a good local internet connection, and stable connection to your VPS
- Large video media will take up to two minutes to buffer on the VPS for transcoding
- Your Android; Windows; iOS; MacOS and 3rd party apps may not like the long buffering times
- Files you upload to ACD do not automatically appear in the mounted drive - See the added
--interval 420
switch in the tutorial
Tutorial
Step 1 - Setup:
Open PuTTY and add a portforward for 127.0.0.1:32400
- Connection > SSH > Tunnels
- Source Port
32400
- Destination Port
127.0.0.1:32400
- Add
nb. Save your connection, otherwise these will be wiped next time you open PuTTY
Step 2 - Upgrades & Prerequisites:
Connect to your VPS and update it, and install prerequisites.
- Connect to your VPS via SSH
- Run
sudo apt-get update
- Run
sudo apt-get -y upgrade
- Run
sudo apt-get -y install git-core python-pip curl fuse
- Run
sudo pip3 install --upgrade pip
Step 3 - Installing Plex:
Install PMS on your VPS
Note: Get the URL from here. Choose 32bit or 64bit for your distro (if in doubt, run uname -a
)
- Run
cd ~/
- Run
wget <URL from the note above>
- Run
sudo dpkg -i plexmediaserver*.deb
Step 4 - Configuring Plex Media Server:
Configure PMS
- Keep PuTTY and your SSH connection open, as it will provide your tunnel to the PMS
- Open a Browser on your local machine and go to http://127.0.0.1:32400
- Login with your Plex username and Password as normal
- Go to Settings
- Go to Server
- Click on
Claim Server
- Plex should error, and ask you to provide your account details
- Enter your account name and password, and it should claim the server successfully
- Go to Remote Settings
- Click on
Manually specify public port
, and enter 32400 in the box - Click
Apply
- Click
Enable Remote Access
- Click
Network
- Click on the
Secure connections
drop down box, and selectRequired
- Click
Save Changes
- This window is no longer needed, and can be closed
- In PuTTY, type
sudo service plexmediaserver restart
- Open your browser and go to
https://<your VPS IP Address>:32400
(note thehttps
)
You should now be able to configure and control the PMS normally.
Step 5 - Installing acd_cli
:
Install acd_cli
Note: I’ll explain this in more detail later if needed
- Run
pip3 install --upgrade git+https://github.com/yadayada/acd_cli.git
- Run
acd_cli sync
- It should ask to open a browser etc… - Press
CTRL
+X
to exit back to the prompt - Open your local browser and go to tensile-runway-92512.appspot.com
- Login with your Amazon Account, and download the
oauth_data
file - Upload the
oauth_data
file to your server in the~/.cache/acd_cli/
directory - Run
acd_cli sync
again, this time it should throw up errors about the root directory (you can safely ignore this)
Step 6 - Testing your ACD mount:
Test mount ACD
- Run
sudo mkdir /mnt/acd
- Run
sudo acd_cli mount -ao /mnt/acd --interval 420
- Run
cd /mnt/acd
- Run
ls -l
and make sure all of your Media is there
nb. If your data is NOT listed, then please post the details, and I’ll look into it
Step 7 - Setting up fstab
to handle automount:
Unmount and configure fstab
to mount ACD on boot
-
Run
cd ~/
-
Run
umount /mnt/acd
-
Run
nano /usr/bin/acdmount
and add the following two lines:#!/bin/bash
acd_cli mount -ao $1 --interval 420
-
Press
CTRL
+X
, then pressY
to save and close -
Run
chmod 777 /usr/bin/acdmount
-
Run
nano /etc/fstab
and add the following line:acdmount /mnt/acd fuse _netdev 0 0
-
Press
CTRL
+X
, then pressY
to save and close -
Run
mount -a
-
Run
cd /mnt/acd
-
Run
ls -l
and make sure all of your Media is there -
Reboot your VPS
-
After rebooting, run
cd /mnt/acd
-
Run
ls -l
and make sure all of your Media is there
Final Notes:
When adding your Media to your Plex Installation, you should be able to browse to /mnt/acd and find your media there.
You may need to tweak your transcoding and bandwidth settings to suit your setup.
Good luck!
Sources
- https://github.com/yadayada/acd_cli
- https://amc.ovh/2015/08/13/infinite-media-server.html
- https://medium.com/@privatewahts/building-an-infinite-plex-media-server-using-amazon-cloud-drive-for-average-computer-users-d16caab62d14#.8aywgygce
- http://makeshift.ninja/
- https://enztv.wordpress.com/2016/10/23/the-almost-complete-guide-to-creating-the-ultimate-plex-server/
- https://acd-cli.readthedocs.io/en/latest/
And others I cant remember…