Report this

What is the reason for this report?

Using ProFTP and Wordpress Together in /var/www/

Posted on September 14, 2014

I’ve set up a Wordpress installation. I’d like to be able to SFTP into the wp-content directory in Wordpress to create a custom theme by saving files directly to the server in the theme directory.

I followed this SFTP using ProFTPd tutorial and modified a few other things in /etc/proftpd/modules.conf:

  • I set DefaultRoot to /var/www/
  • As I had issues creating files (despite being able to connect and see the structure of /var/www/, I also created a directory configuration directive:
  <Directory /var/www/>
    <Limit STOR CWD MKD RMD DELE XRMD XMKD>
      AllowAll
    </Limit>
  </Directory>

I still had issues creating files or this point and assumed it was a result of some unix permissions issues. I went to the var/www/ directory and entered the following two commands:

  • sudo chown -R username:username *
  • sudo chmod -R 0755 *

At this point, the .htaccess file is still owned by www-data but everything else is owned by my unix username (not root). At this point, I could finally SFTP into my server and post files. Terrific!

…Except… When I use Wordpress at this point, I have trouble installing themes or plugins due, I assume, to (yet again) a unix a permissions issue. The error message I get is Unpacking the package… Could not create directory..

I’m no unix expert but it seems like in order to SFTP files into /var/www/ I need to own the files, but that prevents Wordpress from installing items through its web interface.

Can anyone help me configure things in such a way that things will work whether I manually SFTP or try to install a theme or plugin from Wordpress?

Thank you so much for reading. I hope this explanation was helpful.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Thanks @sierracircle – seems like you’re saying I’d have to manually switch back and forth each time I wanted to switch between SFTP and installing updates via wordpress. That’ll be fine once the project launches, I suppose, but a poor solution while I’m building the site.

I was unaware that open-ssh server would allow me to do this, since searching for ftp in the community did not suggest that I could do this via open-ssh server.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.