Edit on GitHub
Jump to docs navigation

Installation / File system permissions

Note: You are currently reading the documentation for Bolt 4.0. 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.

From the Command Line this is easy to fix. Most FTP clients will allow you to do this quickly as well, 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 config/ public/files/ public/theme/ public/thumbs/ var/

Make sure that the root folder is also readable by the web server. On some setups (mainly shared hosting solutions) this is not always the case. To remedy this, run:

chmod a+r .

Setting Permissions (Secure)

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

  • config/
  • public/files/
  • public/theme/
  • public/thumbs/
  • var/

You can achieve this by running:

for dir in config/ public/files/ public/theme/ public/thumbs/ var/ ; 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

Note If you're using SQLite, you must ensure that both the database file as well as the containing folder are writable for the webserver's user. It's stored in var/data/bolt.sqlite by default. This means that it's taken into account in the above instructions. If you've configured the file to be located elsewhere, you might need to set the permissions yourself.

Make sure that the root folder is also readable by the web server. On some setups (mainly shared hosting solutions) this is not always the case. To remedy this, run:

chmod a+r .


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.