Setting Up Samba for Use with Plex (CentOS 7.2 Minimal)
-
There are no guides online that I have found which attempt to teach anyone how to properly install Plex on a CentOS 7.2 server while also explaining what you are actually doing. I'm attempting to do that here but this is also my first guide so I will be editing over time to make it as good as It can be. I'm not a Linux master by any stretch of the imagination. I hope this helps someone in a similar position.
First we will update CentOS (wiki)
yum update -y
You can use
vi
as your text editor but I prefernano
. This is just personal preference.
yum install nano -y
Now we need to install Samba (wiki)
yum install samba samba-client samba-common -y
Change the directory to root and then create the samba directory
cd /
mkdir -p /samba
We need to set permissions and ownership of the samba folder
chmod -r 0777 /samba
<---permissions
chown -r nobody:nobody /samba
<---ownershipNow we will set SELinux (wiki) permissions
chcon -t samba_share_t /samba
At this point it's a good idea to create a backup of your samba configuration file just in case something goes wrong with your configuration.
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
Now we need to edit the samba configuration file.
vi
would be in place ofnano
if you are using that text editor.
nano /etc/samba/smb.conf
Scroll down to Network-Related Options.
workgroup = WORKGROUP
netbios name = Plex
max protocol = SMB3
Remove semicolons before the existing lines so they aren't commented out. Directly below max protocol add the following:
security = user
map to guest = bad user
dns proxy = no
Now you need to create a share definition so we can access Plex from any PC. PgDN or scroll to the bottom of the document and enter the following.
[Plex]
path = /samba
browsable = yes
writable = yes
guest ok = yes
read only = noNow exit and save your changes
Enable the smb and nmb services
systemctl enable smb.service
systemctl enable nmb.service
I always restart the services just in case. This may be unncessary.
systemctl restart smb.service
systemctl restart nmb.service
Firewall permissions need to be created and then the firewall needs to be reloaded
firewall-cmd --permanent --zone=public --add-service=samba
firewall-cmd --reload
Map \<ip address\Plex to your windows PC. Once that succeeds I always create a text file to verify I have write access.
Now, on your Windows PC download: Plex https://www.plex.tv/downloads/ I chose 64bit CentOS
Drag the .rpm file over into the drive you just mapped in Windows.
Back in CentOS we need to run a local install of Plex
cd /samba
ls
<--- To verify that the file is there
yum localinstall plexmediaserver-0.9.16.4.1911-ee6e505.x86_64
[Note: Once you start typing plex you can hit TAB and it will attempt to autofill the file name. Since there is only one file there is no chance of it autofilling the wrong file name.]Let's start the Plex service and stop the firewall service for testing purposes
systemctl start plexmediaserver.service
systemctl stop firewalld.service
On your windows PC open up your browser and test connectivity to your Plex server:
http://<ip address>:32400
Reboot the server.
Stop the Plex service
systemctl stop plexmediaserver.service
Now we need to allow Plex through the firewall (this will be a new document).
nano /etc/firewalld/services/plexmediaserver.xml
Enter the following
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>Plex Media Server</short>
<description>This opens up PlexMediaServer for http (32400), upnp, and autodiscovery.</description>
<port protocol="tcp" port="32469"/>
<port protocol="udp" port="32413"/>
<port protocol="udp" port="1900"/>
<port protocol="tcp" port="32400"/>
<port protocol="udp" port="32412"/>
<port protocol="udp" port="32410"/>
<port protocol="udp" port="32414"/>
</service>Now add the Plex service to the firewall
firewall-cmd --permanent --add-service=plexmediaserver
firewall-cmd --permanent --zone=public --add-service=plexmediaserver
Reboot the server.
On your windows PC open up your browser and test connectivity to your Plex server:
http://<ip address>:32400
Note: In order to use your Plex Media Server remotely you will need to configure port forwarding on your router. The default port as listed above is 32400.Now you can browse your Plex files on your Windows PC and add/remove what you want.
Follow Plex's media preparation guidelines: https://support.plex.tv/hc/en-us/categories/200028098-Media-Preparation
-
I did run into an issue. I allocated 2 TB to the CentOS server but when I attempt to put media into the shared folder it only holds like 50 GB or something. How do I increase the folder size to account for all of that?
-
Check and see what the partition size is for the /
You may need to fix fstab to mount the extra space in /samba
-
@dafyre fsck?
-
@wirestyle22 said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@dafyre fsck?
No, look in /etc/fstab
-
@scottalanmiller said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@wirestyle22 said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@dafyre fsck?
No, look in /etc/fstab
Yeah, /etc/fstab.
If you want to see what is mounted, you can
df -h
And it will show you all the mounted partitions.
-
@wirestyle22 said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
I did run into an issue. I allocated 2 TB to the CentOS server but when I attempt to put media into the shared folder it only holds like 50 GB or something. How do I increase the folder size to account for all of that?
What does
parted -l
show? I'm thinking the only space that is available is the root partition, which should be small. The other space will need to be mounted in /samba, and probably permissions re-applied.
-
I find this guide really confusing. Plex installation should boil down to downloading package with wget and installing it with yum. That and opening firewall ports should be entire guide. Samba is really irrelevant here. Besides, why would anyone want to add anything to Plex manually? That's the job for Couchpotato, Sonarr + Jackett, Headphones and similar apps.
-
@wirestyle22 said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
I did run into an issue. I allocated 2 TB to the CentOS server but when I attempt to put media into the shared folder it only holds like 50 GB or something. How do I increase the folder size to account for all of that?
When giving a CentOS 7 install more than 50GB of drive space it partitions everything over the initial 50GB into its own partition and points /home at it.
-
@marcinozga said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
I find this guide really confusing. Plex installation should boil down to downloading package with wget and installing it with yum.
You probably don't need wget, you might be able to install it directly. Often that is the case.
I agree, this is really a guide to installing nano and Samba, not Plex.
-
@scottalanmiller said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@marcinozga said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
I find this guide really confusing. Plex installation should boil down to downloading package with wget and installing it with yum.
You probably don't need wget, you might be able to install it directly. Often that is the case.
I agree, this is really a guide to installing nano and Samba, not Plex.
They bit about transferring the Plex install just comes down to his admitted inexperience with Linux.
The document as it stands is decent. @wirestyle22 missed a little formatting and needs to retitle it setting up samba for use with Plex.
-
@JaredBusch said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@scottalanmiller said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@marcinozga said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
I find this guide really confusing. Plex installation should boil down to downloading package with wget and installing it with yum.
You probably don't need wget, you might be able to install it directly. Often that is the case.
I agree, this is really a guide to installing nano and Samba, not Plex.
They bit about transferring the Plex install just comes down to his admitted inexperience with Linux.
The document as it stands is decent. @wirestyle22 missed a little formatting and needs to retitle it setting up samba for use with Plex.
But that's the wrong way of working with Plex. Here's a guide of doing it the right way:
https://www.cuttingcords.com/home/ultimate-server/getting-started
It's a guide for Windows, but installation on Linux is very similar. Just ignore the author's statement that Plex is optimized to run on Windows, it's not. Plex server will run on anything, Plex client was build for Mac first, Windows came later.
-
@JaredBusch said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@scottalanmiller said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@marcinozga said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
I find this guide really confusing. Plex installation should boil down to downloading package with wget and installing it with yum.
You probably don't need wget, you might be able to install it directly. Often that is the case.
I agree, this is really a guide to installing nano and Samba, not Plex.
They bit about transferring the Plex install just comes down to his admitted inexperience with Linux.
The document as it stands is decent. @wirestyle22 missed a little formatting and needs to retitle it setting up samba for use with Plex.
Yes, retitling would do the trick.
-
@scottalanmiller said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@JaredBusch said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@scottalanmiller said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@marcinozga said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
I find this guide really confusing. Plex installation should boil down to downloading package with wget and installing it with yum.
You probably don't need wget, you might be able to install it directly. Often that is the case.
I agree, this is really a guide to installing nano and Samba, not Plex.
They bit about transferring the Plex install just comes down to his admitted inexperience with Linux.
The document as it stands is decent. @wirestyle22 missed a little formatting and needs to retitle it setting up samba for use with Plex.
Yes, retitling would do the trick.
I don't get it... He covers configuring the firewall and the Plex services in the OP.
Edit: Granted, there could be more info on configuring your Movie libraries and such after the reboot, etc.
-
@dafyre said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@scottalanmiller said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@JaredBusch said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@scottalanmiller said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@marcinozga said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
I find this guide really confusing. Plex installation should boil down to downloading package with wget and installing it with yum.
You probably don't need wget, you might be able to install it directly. Often that is the case.
I agree, this is really a guide to installing nano and Samba, not Plex.
They bit about transferring the Plex install just comes down to his admitted inexperience with Linux.
The document as it stands is decent. @wirestyle22 missed a little formatting and needs to retitle it setting up samba for use with Plex.
Yes, retitling would do the trick.
I don't get it... He covers configuring the firewall and the Plex services in the OP.
80% of the guide is about setting up samba share.
-
@marcinozga said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@JaredBusch said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@scottalanmiller said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@marcinozga said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
I find this guide really confusing. Plex installation should boil down to downloading package with wget and installing it with yum.
You probably don't need wget, you might be able to install it directly. Often that is the case.
I agree, this is really a guide to installing nano and Samba, not Plex.
They bit about transferring the Plex install just comes down to his admitted inexperience with Linux.
The document as it stands is decent. @wirestyle22 missed a little formatting and needs to retitle it setting up samba for use with Plex.
But that's the wrong way of working with Plex. Here's a guide of doing it the right way:
https://www.cuttingcords.com/home/ultimate-server/getting-started
It's a guide for Windows, but installation on Linux is very similar. Just ignore the author's statement that Plex is optimized to run on Windows, it's not. Plex server will run on anything, Plex client was build for Mac first, Windows came later.
This guide is no different it has little to do with setting up Plex.
how is this the wrong way of working with Plex? There is nothing here about working with Plex beyond installing it.
-
LOL, what's with the next page pointing to the left instead of the typical right?
-
@Dashrender weird
-
@JaredBusch said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@marcinozga said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@JaredBusch said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@scottalanmiller said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
@marcinozga said in Plex Media Server Install Guide (CentOS 7.2 Minimal):
I find this guide really confusing. Plex installation should boil down to downloading package with wget and installing it with yum.
You probably don't need wget, you might be able to install it directly. Often that is the case.
I agree, this is really a guide to installing nano and Samba, not Plex.
They bit about transferring the Plex install just comes down to his admitted inexperience with Linux.
The document as it stands is decent. @wirestyle22 missed a little formatting and needs to retitle it setting up samba for use with Plex.
But that's the wrong way of working with Plex. Here's a guide of doing it the right way:
https://www.cuttingcords.com/home/ultimate-server/getting-started
It's a guide for Windows, but installation on Linux is very similar. Just ignore the author's statement that Plex is optimized to run on Windows, it's not. Plex server will run on anything, Plex client was build for Mac first, Windows came later.
This guide is no different it has little to do with setting up Plex.
how is this the wrong way of working with Plex? There is nothing here about working with Plex beyond installing it.
You said it, title should be setting up samba for use with Plex. Beyond initial media upload to Plex server, which is much more efficient with ftp anyway, there is no need to use samba at all. Adding media to Plex should be automated, and this is where Couchpotato and the likes comes into play.
-
Now that this has derailed, as the issue been looking into any further? What is the next step there?