How to change to Composer based Mautic 7.x?

System: Ubuntu 24.04 - Mautic 7.0.1 - PHP version is: 8.3.6 - Maradb: 10.11.13
My Mautic is in /var/www/html/mautic

I’d like to swith to composer based installation.

First: I’m completely new about composer - but i think, i need to install the composer first?
ChatGPT gave me this as information - but i don’t trust it 100%

Can anyone confirm, that this is the right install-routine for the composer?
If we have here a 100% working methode i would put it in the official manual of Mautic (after i changed my installation myself and check if all is working).

Install Composer

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer --version

Go to the path above
cd /var/www/html

Create a new project (for Mautic 7):

composer create-project mautic/recommended-project:^7 mautic-new --no-interaction
New directory has been created: /var/www/html/mautic-new with Composer structure

Explaining this command:

composer create-project mautic/recommended-project:^7 mautic-new --no-interaction

:one:composer create-project
This is a Composer command that creates a new project from a package.
It downloads the package including all dependencies into a new folder.
Similar to “downloading a ZIP file + extracting it + installing libraries”—only automatic and clean.

:two: mautic/recommended-project:^7

  • mautic/recommended-project → the official Composer package name of Mautic.
  • ^7 → the version restriction, meaning:

Meaning of ^7 in Composer

  • ^ means: compatible versions within the major version 7
  • So ^7 = “7.x.x, but not 8.x.x”
  • Example: Composer could install 7.6.1 or 7.9.0, but never 8.0, because that would potentially be incompatible

In short: ^7 ensures that Composer only downloads updates within the Mautic 7 series, which maintains stability and compatibility.

:three: mautic-new

  • This is the name of the folder where Composer installs the project.
  • After execution, the result is: /var/www/html/mautic-new

:four: --no-interaction

  • Composer does not ask for confirmation or input.
  • Useful for automated installations or scripts, so the command runs without manual intervention.

In short

Teil Meaning
composer create-project New project created from a package
mautic/recommended-project Mautic-Package-Name
^7 Version: all 7.x-versions, no 8.x
mautic-new target-folder
--no-interaction no imputs necessary

:light_bulb: Tip:
If you want to install Mautic 6, for example, you would use ^6.
For future versions, such as 8.x, then use ^8.

Copy folders from the existing installation

Configurations

cp -a /var/www/html/mautic/app/config/local.php /var/www/html/mautic-new/app/config/

Plugins
cp -a /var/www/html/mautic/plugins /var/www/html/mautic-new/

Uploads (Dateien und Bilder)

cp -a /var/www/html/mautic/media/files /var/www/html/mautic-new/media/files
cp -a /var/www/html/mautic/media/images /var/www/html/mautic-new/media/images

Dashboards

cp -a /var/www/html/mautic/media/dashboards /var/www/html/mautic-new/media/dashboards

Themes

cp -a /var/www/html/mautic/themes /var/www/html/mautic-new/themes

Übersetzungen

cp -a /var/www/html/mautic/translations /var/www/html/mautic-new/translations

Save old installation & activate new

sudo mv /var/www/html/mautic /var/www/html/mautic-old
sudo mv /var/www/html/mautic-new /var/www/html/mautic

Setting rights:

sudo chown -R www-data:www-data /var/www/html/mautic
sudo find /var/www/html/mautic -type f -exec chmod 644 {} +
sudo find /var/www/html/mautic -type d -exec chmod 755 {} +
sudo chmod -R g+w /var/www/html/mautic/var/cache \
                     /var/www/html/mautic/var/logs \
                     /var/www/html/mautic/app/config \
                     /var/www/html/mautic/media/files \
                     /var/www/html/mautic/media/images \
                     /var/www/html/mautic/translations

Check Apache:

Apache should access /var/www/html/mautic/public
Apache VirtualHost:

DocumentRoot /var/www/html/mautic/public
<Directory /var/www/html/mautic/public>
    AllowOverride All
    Require all granted
</Directory>

Delete Cache
sudo -u www-data php /var/www/html/mautic/bin/console cache:clear

Is that right? If yes, i would changed my installation and copy / adjust the way official manual for Mautic
If something is missed - or wrong - i need the experts here to adjust errors or add steps.
The result should be a changing tutorials for “beginners” like me.

Important question:
I have many images embended in my e-mails. Does it all works after changing to composer system (image folder has to move - is Mautic able to find the images)?

I tried out to install composer (that worked) but creation a new composer based mautic-new directory failed with some errors.

chatGPT said i have to install manually some things.

I don’t switch to the composer based installation until the Mautic Devs provide a step by step manual.

Hello stefan-franz,

Just a quick clarification about your Composer install example. In your solution you specify mautic-new as the target install directory, which implies creating a new folder.

However, on many hosting platforms (including ours) the target directory already exists, so there isn’t a need — and sometimes there isn’t even permission — to create a new one.

Does your Composer install approach support installing directly into an existing folder instead of creating a new directory? If so, could you clarify the recommended command or workflow for that scenario?

Also, I’ve seen the proposal to remove ZIP-based Mautic installations and move to Composer-only installs. Installing via ZIP is currently simple and quick, whereas Composer installs are more complex and involve multiple steps and dependencies.

Given that difference in complexity, can a developer kindly explain the reasoning behind removing the ZIP installation option - its just making the process more complex than it needs to be ?

Thanks you for your work.

i’ve running Mautic on my own Ubuntu 24.04 server. I have full access.

I agree 100% to you, that a composer installation makes the installation very much complicated.
I refuse to change it. It’s so complicated, that no working tutorial is in the Mautic documentation.

On problems no one knows if the composer had made issues or what the composer really exactly do. At the normal installation we can see if the database works and can download the files and all will working.

I suggest: First lets have a stable V7
And all would be happy.

Hello stefan-franz,

I completely agree — stability must be the absolute priority for Mautic 7. As an open-source marketing automation platform used in production environments around the world, including enterprise deployments, reliability isn’t optional — it’s foundational to trust in Mautic.

Just use Claude.AI instead of chatGPT for all mautic things, that solved my struggle many times (for install, and upgrading also) ;D

Hello diamondtheta,

Thanks a lot for this tip — it’s genuinely very useful.

It will really help with both installing Mautic properly and writing cleaner Mautic and Symfony code. I appreciate you taking the time to share it!

Thanks.

Please shut down and power off the server, and cancel your subscription.

You’re using SUDO for everything in your explanation. It seems you don’t even have a basic understanding of Linux, let alone what Composer or similar tools mean or do.

Constantly using SUDO shows that your permissions within the directories where you’re working are incorrect.

If you must do it, at least use Docker or a Docker stack. That way, if you’re compromised by a hacker, they’re contained within that environment and would have to break out to reach the actual server.

Sorry to say this, but it’s only meant well and is safer for all of us.

A forum is a place where members help each other.
Your post helps nothing.

If you really have a knowledge, feel free an describe here something or contribute Mautic to create a tutorial.

Hello stefan-franz,

Thank you for genuinely trying to help another Mauitc user on this forum which is a rare event these days. I thank you again for your efforts.

Hello csaeum,

You were quick to criticise another user’s attempt to help, but didn’t offer a solution, correction, or any practical guidance yourself.

If you have the knowledge, then share it—don’t just criticise others who are trying to contribute. In technical discussions like this, feedback is only useful when it’s paired with something constructive.

If the suggested approach is wrong, explain why and provide the correct method so everyone benefits. Otherwise, it doesn’t really move the discussion forward.

If you are not going to contribute to the forum in a positive way then do us all a favour and consider cancelling your forum account.

Thanks.