How do I add folders to my plex server?

Server Version#:
Player Version#:
<If providing server logs please do NOT turn on verbose logging, only debug logging should be enabled>

It’s a very simple question - but past help has led me to this dead end that no matter how many guides I read or how much I go over past threads, there is no way I can see to add a damn folder to my server.

Please assist.

you create a library such as a movie library and in the library set up tell it the folder(s) your movies are in.

https://support.plex.tv/articles/200288926-creating-libraries/

https://support.plex.tv/articles/#cat-your-media

When I go to create a library from the app.plex.tv in my browser, and browse folders, the folders with my music collection aren’t present.

Do you know how to add folders to a library when the folders on the linux server are showing up?

Because that’s the current topic of this thread.

Please try to stay on topic.

If you can’t navigate to the folder in Plex’s “Browse For Media Folder” dialog, it’s almost always a permissions issue (i.e. the user Plex is running as doesn’t have permission to see/navigate into the folder).

It’s not a permission issue. Something needs to be done on the linux server to add the folder to be able to show up. But I don’t know what that something is.

I’m not sure how your media drives are mounted or connected to computer but if network drives…

– If using SMB, the shared folder must be mounted with allow_other permission
– If using NFS, the shared folder is best mounted with sec=sys option

In both cases:
– The mount point directory must have 755 permissions prior to the mount and again AFTER the mount (apply the chmod twice)

I’m guessing the music folder exists on your OMV box. Is the folder shared? If you log into the container, is the shared folder mounted?

This video might help - https://www.youtube.com/watch?v=No81yx14yS8

1 Like

Anytime my server restarts, I have to re-run a script to completely re-create the server. Which is another ongoing issue that I can’t seem to get a straight answer to.

That script follows:

#
# Update docker and (re)create container
#
# Update image first
Image="$(sudo docker images | grep plex | awk '{print $3}')"

if [ "$Image" != "" ]; then

  sudo docker stop plex
  sudo docker stop plex
  sudo docker rm plex
  sudo docker rmi -f $Image
fi

sudo docker run \
-d \
--name plex \
--network=host \
-e PLEX_CLAIM="claim-qPpfokcN_RhDdhe7uTrk" \
-e TZ="EST" \
-e LANG="en_US.UTF-8" \
-e PLEX_UID=1000 \
-e PLEX_GID=1000 \
-e PUID=1000 \
-e PGID=1000 \
-h plex-omv \
-v /Storage/Plex-OMV:/config \
-v /Storage/Video/Movies:/movies \
-v /Storage/Video/TV:/tv \
-v /vie:/data \
--device=/dev/dri:/dev/dri \
plexinc/pms-docker:plexpass

docker start plex

docker update --restart=unless-stopped plex

From reviewing this script, it seems the following lines

-v /Storage/Video/Movies:/movies
-v /Storage/Video/TV:/tv \

are the piece of syntax that specify the folders that contain movies and tv shows.

From a linux prompt, if I browse to the /Storage/Video/TV path, sure enough, that is where my TV shows are.

However, what doesn’t make sense to me is that the movie path is incomplete - that’s a parent folder that contains more than just movie rips for plex.

When I go into app.plex.tv, and go into settings, and go into manage - libraries, and hover over movies, and select the option to edit it, it shows this:

I don’t understand how my script I have to run everytime I restart to get my server back specifies the parent folder, yet the library itself is pointing to a folder within that folder.

I don’t know how any of this got set like this in the first place.

So, meanwhile, I have several folders contained in a path of /Storage/Media

Some of these folders I’d like to add as music libraries, but I want them to show up separately somehow, since there may be duplicates of albums which will confuse things and make things a navigation nightmare (having the same album on a CD, vs DVD, vs DVD-A, vs SACD, vs blu-ray)

So I guess a list of questions I have at this point is:

would the syntax of -v /Storage/Media:/music \ be involved in adding this folder to show up when adding a library?

If so, how do I run that, as that is part of a fuller syntax, and re-running the whole script every time is probably not correct?

Also - what do I need to do to not have to run this full script every time my server needs a restart?

MODERATOR EDIT: Code legibility

I don’t know what a portainer is, but I do know that’s the nightmare that was even worse than my current nightmare that started this whole mess. Stay away from that hot garbage. Following a guide like that youtube video is exactly what started this mess.

@armyofquad1

I’m here (following in the background). I have some things to do this afternoon but will have time to show you what to do & how to do it.

Would you please confirm for me what you have / want to do?

  1. OMV is your media storage ?
  2. Where does PMS run? On the OMV box or on a different computer ?
    – If a different computer, which OS & version ?

Based on the script you posted, it looks like you only have Movies & TV shows mounted in your docker. container.

If you open a terminal and run this command “mount”

I’m guessing you’ll see an output similar to:

/Storage/Video/Movies:/movies /movies/Plex
/Storage/Video/TV:/tv /tv/Plex

Based on the script, It does not look like it is mounting a music folder to the container

  1. Yes, OMV is my media storage.
  2. PMS runs on the OMV box.

It seems that adding the line of -v /Storage/Media:/music \ to the script and re-running the script has added Media as a folder when I go to add a library, so I guess I’m past that hurdle.

I do think it would be useful for me to understand how to maintain that - how to add folders in the server. Does it require editing and running that full script? Or should I know a series of commands to run in the terminal to add it without having to run that full script?

I also want to understand why it is I have to run that script again every time the server restarts, and how to setup the server to automatically start things again on boot so that plex is automatically back online with a restart.

Can you try this? Again, I’m not familiar with docker but I presume it uses mover systemctl

open a terminal, do “sudo -i” That will give you root privileges

at the prompt, enter “systemctl enable plexmediaserver” and hit enter

restart your docker container and see if plex starts up

@armyofquad1

Cool.. we can do this easily.

  1. I see that you copied my dockerplex container spec. :slight_smile:
  2. Because of your usage, you don’t need a lot of the stuff in there.
  3. I’m in the process of setting up an OMV VM to run a Plex container in.
  4. I’ll then , copying what you did, replicate your environment with my pathnames. (you’ll see)

To start, Adding new folders follows the docker syntax:

-v REAL_PATH : Container_Path

In a container specification, it looks like this with the \ continuation at the end.

-v "source path on host":/path_in_container \

I am showing you how to use quotes for either side. If you don’t need them then OK.

So far so good?

If you have

-v /Storage/Music:/music/Plex \

is one way to do it .. but you don’t need the /Plex inside the container.

Regarding my script.

  1. It recreates the container and downloads a fresh image. harsh but effective
  2. We can reconfigure it to be used when you want a new container.
  3. We can enable Docker itself (what you want) to run at startup (what you want)
2 Likes

Excellent. Thank you so much, this is exactly what I needed.

From this response, I take it to mean that the correct way to add another folder to docker from the server as needed is to edit and re-run the script. Good to know, I will hold onto that.

I guess that means the next thing is figuring out how to enable Docker to run at startup. But that can wait until time permits, the box doesn’t restart all that often, only with power failures.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.