I am trying to create an FTP user that can manage the /var/www directory which is owned by www-data.

I have seen a post suggesting this:

chown -R newuser:www-data /var/www

How do I create a user and allow that user to manage /var/www without changing ownership of that directory?

  • 2
    Adding newuser to the www-data group may be what you're looking for ...
    – matigo
    Commented Oct 13, 2021 at 13:17
  • @matigo Thank you. When I do that the user is not able to create any files or directories. Commented Oct 13, 2021 at 13:19
  • 2
    FYI Apache doesn't need to own the directory, you need to give www-data proper permissions in the subdirs to traverse/recurse. That'll be dependent on your application. I have NUMEROUS applications running in myuser:www-data setups where I own the files and can edit but so can Apache where it needs to. That's a permissions issue that can be resolved easily, Apache doesn't need to own the directory it just needs access to directories and such where it needs ti (based on what your site's application needs are)
    – Thomas Ward
    Commented Oct 13, 2021 at 13:32

1 Answer 1


Do not change the owner of the website files, the problem you encountered may occur
Add your editor user to the www-data user group

sudo usermod -a -G www-data newuser

Working with user groups is in line with good practice standards

If you need help with the ftp server setup (directory permissions and restriction), you should specify which ftp server your are running.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .