SugarCRM 7 — Roll SugarCRM with Docker

Shane Dowling
Apr 7, 2015 · 2 min read
Image for post
Image for post

I find trying to replicate the SugarCRM environment locally a real pain.
One of the main issues is simply that Sugar requires such old versions
of PHP to be installed, especially compared to other web projects I have
that implement the latest/greatest versions of PHP. Running multiple PHP
versions simultaneously can be a pain. One solution is to use Vagrant
but I find that too heavy for my needs, so I gave docker a go and found
it a much faster/elegant solution.

Here’s the steps to get yourself up and running.

1. MySQL

You’ll need your own installation of MySQL for this. As I use Debian
testing as a host I just installed MySQL on it and have my SugarCRM
boxes point to the host using the dockerhost entry in /etc/hosts on each
docker container.

There is nothing at all stopping you from creating another Docker
instance running MySQL but I figured this was an unnecessary step and
getting data persistence working with Docker can be a little annoying.

2. Getting the Docker config

Simply clone the repo for whichever version you intend to you use.

I have two versions of this setup for both SugarCRM Version 7.2(Needing
PHP 5.3) and Version 7.5(Needing PHP 5.4).

Sugar-Docker 7.2 is here.
Sugar-Docker 7.5 is here.

3. Fill in Docker settings

run.sh

Edit this script and change the containers ip to whatever your hosts ip
is. Don’t forget to set the folder to your SugarCRM code folder.

files/vhost.conf

Change settings here if you wish to use a custom url to access Sugar or
if you have multiple instances of SugarCRM installed.

files/php.ini

Change any settings you might want to customise with PHP here.

4. Tell SugarCRM to use the right MySQL database

In config.php I just set the mysql host to dockerhost.

5. Hosts entry

Then on your host operating system make sure to point the virtualhost
url to the box. For me, in my /etc/hosts I have this entry.

127.0.0.1 sugar.dev

Debugging

Because I’ve used stdout for logs you can see apache errors by running a
command like this.

sudo docker logs -f sugarcrm72

Tech Blog

Random smattering of technical posts

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store