# Installing via Composer

**URL:** <https://forum.mautic.org/t/installing-via-composer/30081>\
**Category:** Mautic 4 Install/Upgrade Support\
**Created:** [November 29, 2023, 10:55pm UTC](https://forum.mautic.org/t/installing-via-composer/30081 "2023-11-29T22:55:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gabe/32/436_2.png) [@gabe](https://forum.mautic.org/u/gabe)\
**Post date:** [November 29, 2023, 10:55pm UTC](https://forum.mautic.org/t/installing-via-composer/30081/1 "2023-11-29T22:55:42Z")

</div>

**Your software**  
_My PHP version is_ : php8.0

**Updating/Installing Errors**  
_I am_: Installing  
_Upgrading/installing via_ : Command Line

**Your problem**  
_My problem is_ :  
I’m trying to understand the best way to install via composer so that the marketplace is usable, and there are no problems with upgrading mautic in the future. I find the [official docs](https://mautic-documentation.readthedocs.io/en/latest/getting_started/how_to_install_mautic.html#installing-with-composer) to not be clear about this. If all I want to do is set up a production server that can use the marketplace, should I be using the recommended project or should I just be doing a `git clone` from the 4.4 branch and then a `composer install`?

If I do the latter, how will I be able to update to future Mautic releases? Do I have to manually `git pull` and `composer install` for every release?

If I use the recommended project, how will updates to new mautic releases work?

It said somewhere in the docs that starting with version 5 composer will be the default installation method. Is that still the plan? If so, we really need to get our docs updated to make this stuff clearer…

---

<div class="post-metadata">

**Author:** ![gabe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gabe/32/436_2.png) [@gabe](https://forum.mautic.org/u/gabe)\
**Post date:** [December 4, 2023, 11:58pm UTC](https://forum.mautic.org/t/installing-via-composer/30081/2 "2023-12-04T23:58:46Z")

</div>

@silavapi Care to comment on this? If I can figure it out I’d be happy to pay it forward by improving the documentation…

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [December 8, 2023, 11:15am UTC](https://forum.mautic.org/t/installing-via-composer/30081/3 "2023-12-08T11:15:39Z")

</div>

Hi @gabe thanks for the ping.

You should install using recommended project, per the [documentation](https://mautic-documentation.readthedocs.io/en/latest/getting_started/how_to_install_mautic.html#using-the-recommended-project).

You update Mautic’s core by following the documentation on the [same page as the installation](https://mautic-documentation.readthedocs.io/en/latest/getting_started/how_to_install_mautic.html#updating-mautic-core).

Indeed we do need to make things more user-friendly as regards the docs, these were very much written in haste before we released Composer support - would you like to help us with that?

I’d love it if we can make a ‘best practice for installing and updating Mautic’ page which gives a step-by-step of how to install and update with Composer for someone who isn’t a server-management expert.

We’re likely pushing back the mandatory use of Composer to 6.0 as we’ve simply not had the resources to get everything in place to support users with moving to Composer from manual installs (and getting the docs up to standard) yet.

---

<div class="post-metadata">

**Author:** ![gabe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gabe/32/436_2.png) [@gabe](https://forum.mautic.org/u/gabe)\
**Post date:** [December 8, 2023, 11:42pm UTC](https://forum.mautic.org/t/installing-via-composer/30081/4 "2023-12-08T23:42:18Z")

</div>

That is very helpful, thank you @silavapi! I will suggest changes to the docs based on this discussion. But I do need to fully understand it myself in order to do so, and I have a couple more questions:

1. When I follow the instructions to migrate to composer using the recommended project documentation, I can’t get my Mautic to load at all. I believe that’s because many of the configs in local.php need to change to match the different folder structure of the recommended project but none of the current docs address that. Is it the case that the paths need to be adjusted when moving to a composer-based install and the docs just don’t cover that yet?
2. How do updates work once you’re on composer? The documentation implies that `composer update mautic/core-lib --with-dependencies` will work but that only updates the PHP right? What about the db changes? Do the `php bin/console mautic:update:find` and `php bin/console mautic:update:apply` commands still work?

The way the docs are talking about the recommended project, it seems like it’s meant for folks who want to maintain their Mautic install off of a Github branch rather than just getting the default mautic install. This is especially true for the updating Mautic section, which seems to be written for people who have their own modifications (and is probably a very small percentage of the user base). I’m happy to address these things once I understand it myself…

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [December 8, 2023, 11:53pm UTC](https://forum.mautic.org/t/installing-via-composer/30081/5 "2023-12-08T23:53:03Z")

</div>

Hi there,

1. Please check the documentation on switching to a Composer based installation: [How to switch to Composer — Mautic Documentation 0.1 documentation](https://mautic-documentation.readthedocs.io/en/latest/getting_started/switching_composer.html)

2. Please read the documentation which explains [updating Mautic core](https://mautic-documentation.readthedocs.io/en/latest/getting_started/how_to_install_mautic.html#updating-mautic-core), in particular, step 5:

> 5 Run the following commands to update your database with any changes from the release:
> 
> bin/console cache:clear  
> bin/console mautic:update:apply --finish  
> bin/console doctrine:migration:migrate --no-interaction  
> bin/console doctrine:schema:update --no-interaction --force  
> bin/console cache:clear

Hope that makes sense!

We probably do need to pull the updating Composer section into its own page under the [Updating Mautic](https://mautic-documentation.readthedocs.io/en/latest/getting_started/how_to_update_mautic.html) menu item, I guess.
