---
title: 'How I failed installing Mautic with Composer'
url: 'https://johnlinhart.com/blog/how-i-failed-installing-mautic-with-composer'
markdown: 'https://johnlinhart.com/blog/how-i-failed-installing-mautic-with-composer.md'
date: '2019-12-23'
description: "TL;DR I tried to prepare a composer.json file that would install Mautic in the the vendor foler. That wasn't the hard part. I got stuck on making Mautic work that way. Using Composer to install PHP packages is great. Why shouldn't we install Mautic this way? I wanted to make it work mainly because …"
taxonomy:
  tag:
    - mautic
    - developer
    - technology
    - composer
  archives_month:
    - dec_2019
  archives_year:
    - '2019'
---

# How I failed installing Mautic with Composer

[ Blog ](https://johnlinhart.com/)      How I failed installing Mautic with Composer    

   23 *Dec*   
#### [How I failed installing Mautic with Composer](https://johnlinhart.com/blog/how-i-failed-installing-mautic-with-composer)

  [mautic](https://johnlinhart.com/tag:mautic) [developer](https://johnlinhart.com/tag:developer) [technology](https://johnlinhart.com/tag:technology) [composer](https://johnlinhart.com/tag:composer)  

TL;DR I tried to prepare a composer.json file that would install Mautic in the the vendor foler. That wasn't the hard part. I got stuck on making Mautic work that way.

Using Composer to install PHP packages is great. Why shouldn't we install Mautic this way? I wanted to make it work mainly because I want to [install Mautic plugins via Composer](https://johnlinhart.com/blog/mautic-marketplace-proposal#mautic-update). And installing/updating Mautic with Composer would make it simpler.

It would allow to install and update plugins and themes as well as Mautic the same way - via Composer. And if we'd want to update Mautic and one of the plugins would not support the new Mautic version then Composer would tell us. That's quite useful information to know before the upgrade.

I'll document here what I did and where I got stuck so someone else with more patience could pick it up and continue. It's definitelly possible but it will probably need some changes in Mautic.

You can follow my steps by creating a new directory. Add this composer.json file in it:

```
{
    "name": "mautic/composer-install",
    "description": "Creates a new project and installs Mautic as a dependency. Then it will move to the right folder structure.",
    "type": "metapackage",
    "license": "GPLv3",
    "require": {
        "mautic/core": "^2"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/mautic/mautic"
        }
    ],
    "minimum-stability": "dev"
}
```

And then from that folder execute this command: `composer create-project` ([install Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos "This link will take you to an external web site. We are not responsible for their content.") if you don't have it yet)

That's all it takes to install Mautic as a dependency. My plan was to add several symlinks to the [post-create-project-cmd](https://getcomposer.org/doc/articles/scripts.md#command-events "This link will take you to an external web site. We are not responsible for their content.") sections to the index.php, console, etc. It will also need some paths chages to the autoloader as the path is different. But even if I fixed that Mautic did not load.

There would be other issues even if I made it load. Mautic writes quite a lot into its own file structure. Config file, assets, plugins, themes, cache. All those would have to be symlinked or configured outside of the vendor directory.

Edit: A similar and working project already exists: [https://github.com/TheDMSGroup/mautic-eb](https://github.com/TheDMSGroup/mautic-eb "This link will take you to an external web site. We are not responsible for their content.")

Edit 2: [There is a simple way how to install Mautic via Composer](https://johnlinhart.com/blog/install-mautic-via-composer). Just not as a dependency but as its usual file structure.

 [ Next Post](https://johnlinhart.com/blog/install-mautic-via-composer) [Previous Post ](https://johnlinhart.com/blog/mautic-marketplace-proposal)

#### Projects I'm part of

 **[Mautic](http://mautic.org)** Open source marketing automation software.
 **[Calculoid.com](http://calculoid.com)** Web app which lets you create a calculator.
 **[eScope.cz](http://escope.cz/en)** My Joomla! articles and extensions.
 **[CRMery](http://crmery.com)** CRM as Joomla component.
 **[Constimator.com](http://constimator.com)** Web app which lets you calculate cost of building. 

#### For stalkers

 [](https://github.com/escopecz "GitHub") [](https://twitter.com/jan_linhart "Twitter") [](http://stackoverflow.com/users/2421302/escopecz "Stack Overflow") [](https://cz.linkedin.com/pub/jan-linhart/52/a03/80a "LinkedIn") [](http://magazine.joomla.org/component/k2/itemlist/user/5517-janlinhart "Joomla Magazine") 

#### Popular Tags

  [mautic](https://johnlinhart.com/tag:mautic) [developer](https://johnlinhart.com/tag:developer) [technology](https://johnlinhart.com/tag:technology) [web development](https://johnlinhart.com/tag:web%20development) [notes](https://johnlinhart.com/tag:notes) [composer](https://johnlinhart.com/tag:composer) [marketing](https://johnlinhart.com/tag:marketing) [personal](https://johnlinhart.com/tag:personal) [cronfig](https://johnlinhart.com/tag:cronfig) [hobby](https://johnlinhart.com/tag:hobby) [webexpo](https://johnlinhart.com/tag:webexpo) [freelance](https://johnlinhart.com/tag:freelance) [cost](https://johnlinhart.com/tag:cost) [calculator](https://johnlinhart.com/tag:calculator) [rate](https://johnlinhart.com/tag:rate) [calculoid](https://johnlinhart.com/tag:calculoid) [wordpress](https://johnlinhart.com/tag:wordpress) [grav](https://johnlinhart.com/tag:grav) [pagekit](https://johnlinhart.com/tag:pagekit) [cms](https://johnlinhart.com/tag:cms) [john](https://johnlinhart.com/tag:john) [name](https://johnlinhart.com/tag:name) 

#### Archives

- [ 1 November 2024  ](https://johnlinhart.com/blog/archives_month:nov_2024)
- [ 1 October 2024  ](https://johnlinhart.com/blog/archives_month:oct_2024)
- [ 5 March 2023  ](https://johnlinhart.com/blog/archives_month:mar_2023)
- [ 1 January 2020  ](https://johnlinhart.com/blog/archives_month:jan_2020)
- [ 2 December 2019  ](https://johnlinhart.com/blog/archives_month:dec_2019)
- [ 1 September 2019  ](https://johnlinhart.com/blog/archives_month:sep_2019)
- [ 1 August 2018  ](https://johnlinhart.com/blog/archives_month:aug_2018)
- [ 1 November 2016  ](https://johnlinhart.com/blog/archives_month:nov_2016)
- [ 1 September 2015  ](https://johnlinhart.com/blog/archives_month:sep_2015)
- [ 1 June 2015  ](https://johnlinhart.com/blog/archives_month:jun_2015)
- [ 1 May 2015  ](https://johnlinhart.com/blog/archives_month:may_2015)
- [ 1 April 2015  ](https://johnlinhart.com/blog/archives_month:apr_2015)

#### Syndicate

 [ Atom 1.0](https://johnlinhart.com/blog.atom) [ RSS](https://johnlinhart.com/blog.rss)

---

## Navigation

- Parent: [Blog](https://johnlinhart.com/index.md)
- Previous: [Install Mautic via Composer](https://johnlinhart.com/blog/install-mautic-via-composer.md)
- Next: [Mautic Marketplace Proposal](https://johnlinhart.com/blog/mautic-marketplace-proposal.md)
