Edit on GitHub
Jump to docs navigation

Installation / File system permissions (flat structure)

Note: You are currently reading the documentation for Bolt 3.7. Looking for the documentation for Bolt 5.2 instead?

On most servers the web server runs in a different group than your user account, so to give Bolt write access to these files you have to use the chmod command.

For most things, your web server just needs to be able to read Bolt's PHP, JavaScript, CSS, Twig and other files.

However, Bolt must be able to read and write certain directories.

Most FTP clients will allow you to do this quickly, using a 'include files' or 'apply to enclosed' option.

Setting Permissions (Quick & Easy)

This approach is not recommended, but for some hosts, or to just get moving quickly, run these commands from inside your Bolt directory:

chmod -R 777 app/cache/ app/config/ app/database/ extensions/
chmod -R 777 thumbs/ files/ theme/

Setting Permissions (Secure)

Bolt must have write permissions to the following directories and their files:

  • app/cache/
  • app/database/
  • thumbs/

You can achieve this by running:

for dir in app/cache/ app/database/ thumbs/ ; do
    find $dir -type d -print0 | xargs -0 chmod u+rwx,g+rwxs,o+rx-w
    find $dir -type f -print0 | xargs -0 chmod u+rw-x,g+rw-x,o+r-wx > /dev/null 2>&1
done

For back-end administration using the UI, we strongly advise making the following directories, and the files contained within, writeable by the web server user:

  • app/config/
  • extensions/
  • files/
  • theme/

You can achieve this by also running:

for dir in app/config/ extensions/ files/ theme/ ; do
    find $dir -type d -print0 | xargs -0 chmod u+rwx,g+rwxs,o+rx-w
    find $dir -type f -print0 | xargs -0 chmod u+rw-x,g+rw-x,o+r-wx > /dev/null 2>&1
done


Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.