I am running an ubuntu server.

Chown -R plex.plex /Folder just changes the permission of the current folder/subfolders/files. If i create a new folder it doesnt change the ownership to what i want. for example

chown -R plex.plex /media/plex_media

if i create a new folder inside plex_media. the new folder goes back to root. I need all future folders/files to be plex in that plex_media

  • Is your chmod command correct?
    – vanadium
    Sep 17 at 16:08
  • First what version of Ubuntu are you using? Second are you doing this logged in as the root user?
    – David
    Sep 17 at 16:44

2 Answers 2


when you create a directory, the directory will automatically be owned by the user you are using at that time.

for example you make a directory with root user, the the owner of directory is root.

Here are some ways that I recommend for you :

  1. create new directory and change owner, i.e :

mkdir new_dir && chmod -R flex:flex new_dir

  1. create directory using flex user, from root you can login as flex user using command :

sudo -u flex mkdir new_dir

hope this help

  • 1
    Wondering about the downvote as this is correct information. Any directory created by root will be owned by root. I would suggest changing the second option to sudo -u flex mkdir new_dir to keep it in one command.
    – doneal24
    Sep 17 at 17:31
  • Thanks for suggestion, Ihave update the answer 🙂 @doneal24
    – Deki Akbar
    Sep 17 at 22:45

I am not sure what was the issue but deleted the folder and re created the folder as root and then used chown -R plex.plex /folder and everything is working as expected

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.