Shane Dowling : SugarCRM — Sugar powered by Salt!

SugarCRM can be a pain to setup, especially if you are managing many installs on different servers/environments. I'm a big fan of using salt to configure my servers. I rarely manage any servers directly anymore and generally run things through my salt master. This guide should hopefully get you up and running with a production ready setup of SugarCRM that you can re-use over and over. If you are looking for a decent primer on saltstack, this video will give you a really useful introduction to what salt can really do. I'm barely scratching the surface.


  1. Install salt on the server you with to act as the salt-master(the provisioner). DigitalOcean is great and cheap for this sort of non-mission critical task.
  2. Spin up a new server(which will be production), install/configure the salt-minion and point it at the master.
  3. Clone this repo to your salt-master or fork and create your own. You'll need to do a bunch of customisations that you'll want private.
  4. Do a grep -iRn 'TODO' sugar_salt/* and fill in all details and copy files where needed.
  5. Overwrite or merge this folder with your existing /srv/salt.
  6. Run a sudo salt-call -l debug state.highstate on the minion box you've setup. This will give you a ton of output and let you know if anything has gone wrong.

What this configuration gives you

  1. A set of core server essentially tools including git, vim, curl etc.
  2. Systat which I find essential for finding out what's causing potential issues on servers.
  3. All of SugarCRMs LAMP requirements, including redis, elasticsearch, composer and apt-pinning to php 5.3.
  4. Correct php config including recommended increases to memory limit.
  5. Correct server permissions for your SugarCRM codebase.
  6. Ensures correct config files are always maintained.
  7. Ensures the correct htaccess files is always maintained.
  8. Ensures cache, upload directories exist with the correct permissions.


  1. This configuration is tested on Ubuntu servers ONLY, specifically 12.04. If you intend to use this on something else please verify this works with a virtual machine before using on production machines. Salt plays really well with vagrant, in fact I actually manage all of my development, testing and production boxes using salt and this includes the development Vagrant boxes on my laptop. Specifically you'll probably want to change the php.ini that might not play nice with your alternate OS of choice.
  2. One improvement that could be made is to in fact keep config.php and config_override.php in version control but have the take in environment variables that salt could maintain(or your server).
  3. This is actually a little different to how I generally configure my SugarCRM boxes with salt. This configuration is not as re-usable as it could be, so what I do is abstract everything that's per server into their own sub-folders and everything that repeats per server into it's own server. I haven't shown this here for the sake of simplicity but is should be fairly straight forward.
  4. This repo was setup with SugarCRM 7 in mind. With the requirements specified here. Alter the configuration files based on the requirements of the version that's applicable to you.

Any tips or improvements(I'm sure there's plenty), feel free to comment.