Note: You are currently viewing documentation for Moodle 2.5. Up-to-date documentation for the latest stable version of Moodle may be available here: admin/mdeploy/notwritable.
For Moodle to install plugins automatically, you need to make certain directories writeable by the web server process. The "apache" user is common on Unix-based systems using the Apache web server.
The exact directories depends on the type of plugins. For a full list of directories see the Moodle path on https://docs.moodle.org/dev/Plugins
For example Moodle activities are stored in the /mod directory, so you might do this:
cd <your main moodle directory> chown -R apache mod chmod -R u+rw mod
See also more about Installing plugins.