This article will guide you through setting up Mautic locally for use and for development.
A basic knowledge of Terminal is good, although you should be able to follow along, as the commands are all fairly simple. They are mainly to get the prerequisite components installed and running.
Mautic uses Git as a version control system. Download and install git for your OS from Git-download.
If you already have Git installed, you can get the latest development version via Git itself:
git clone https://github.com/git/git
AMPPS is an easy to install software stack of Apache, Mysql, PHP, Perl, Python and Softaculous auto-installer that can be used on Desktops and office servers.
Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. There are two ways to install Composer
locally as part of your project, or
globally as a system wide executable.
You can easily download and install composer on Windows, Linux and Mac OS X by downloading it from here
npm i grunt
After installing the development / build process required,we would install Mautic locally on our system by following these steps:
Note: To use Mautic you will need to set up a web server for example; Apache HTTP Server,Nginx Web Server.
cd /var/wwwif your local server root is at /var/www).
Mautic downloaded from GitHub has the development environment. You can access it by adding
index_dev.php after the Mautic URL.
Eg. http://localhost/mautic/index_dev.php/s/. Or in case of CLI commands, add
--env=dev attribute to it.
This development environment will display the PHP errors, warnings and notices directly as the output so you don't have to open the log to see them. It will also load for example translations without cache, so every change you make will be visible without clearing it. The only changes which require clearing the cache are in the
In case of assets like JS, CSS, the source files are loaded instead of concatenated, minified files. This way the changes in those files will be directly visible on refresh. If you'd wanted to see the change in the production environment, you'd have to have run the
app/console mautic:assets:generate command.
In many cases, the CSS files are built from LESS files. To compile the changes in the LESS files, run grunt compile-less command.
Source Files Each time you update Mautic's source after the initial setup/installation via a new checkout, download, git pull, etc; you will need to clear the cache. To do so, run the following command:
$ cd /your/mautic/directory $ php bin/console cache:clear
Note: that if you are accessing Mautic through the dev environment via
index_dev.php, you would need to add
--env=dev to the command).