# DDEV setup with composer, uploaded images etc. getting added to git

**URL:** <https://forum.mautic.org/t/ddev-setup-with-composer-uploaded-images-etc-getting-added-to-git/36291>\
**Category:** Product Support\
**Created:** [August 9, 2025, 12:53pm UTC](https://forum.mautic.org/t/ddev-setup-with-composer-uploaded-images-etc-getting-added-to-git/36291 "2025-08-09T12:53:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lolcode](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/lolcode/32/12928_2.png) [@lolcode](https://forum.mautic.org/u/lolcode)\
**Post date:** [August 9, 2025, 12:53pm UTC](https://forum.mautic.org/t/ddev-setup-with-composer-uploaded-images-etc-getting-added-to-git/36291/1 "2025-08-09T12:53:55Z")

</div>

**Your software**

My Mautic version is: 5.2.7  
My PHP version is: 8.2.29  
My Database type and version is: MariaDb 10.11

**Your problem**

My problem is: I used a composer create-project install of Mautic

All the images that I have uploaded are being proposed to be added to Mautic.

The default gitignore in Mautic does not cover docroot at all.

> <https://github.com/mautic/mautic/blob/f9dfe45a0ef933c87cdb8c4c3fdecd8608b41f7e/.gitignore>

**Steps I have tried to fix the problem:**

I haven’t tried any. I am looking for recommendations. I guess one possibility is to add a composer post-install script that patches the .gitignore ??

I see similar concerns in this older post.

> [@Best-practice discussion: How to setup a Mautic installation as project with Git?](https://forum.mautic.org/t/best-practice-discussion-how-to-setup-a-mautic-installation-as-project-with-git/26864):
>
> Hello everyone. I’ve just installed a test project with DDEV following this [blog-post](https://www.mautic.org/blog/developer/local-mautic-development-with-ddev). The only modification I made is to specify docroot: docroot inside of .ddev/config.yaml (I see this as absolute best practice to install a software to a public or docroot folder, instead of project-root, because we want to have a packages-folder for custom plugins, themes and other stuff, which are symlinked during deployment from there). Here comes the problem: If I make git init in the project-root, ALL i…

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [September 8, 2025, 7:37am UTC](https://forum.mautic.org/t/ddev-setup-with-composer-uploaded-images-etc-getting-added-to-git/36291/2 "2025-09-08T07:37:19Z")

</div>

Can you please clarify why you need .gitignore when you are installing through Composer?

---

<div class="post-metadata">

**Author:** ![lolcode](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/lolcode/32/12928_2.png) [@lolcode](https://forum.mautic.org/u/lolcode)\
**Post date:** [September 8, 2025, 3:45pm UTC](https://forum.mautic.org/t/ddev-setup-with-composer-uploaded-images-etc-getting-added-to-git/36291/3 "2025-09-08T15:45:01Z")

</div>

It is critical. When I create a project through composer I am trying to manage my installation using code - using devops. If I add a plugin or apply a patch I will manage it through composer. I will push the codebase to our internal github so that other developers can check out the internal install with all plugins, theme etc.

This is the process I have become used to over many years in the Drupal community. I think it is common practice in multiple other communities as well.

[https://www.drupal.org/docs/develop/using-composer/manage-dependencies](https://www.drupal.org/docs/develop/using-composer/manage-dependencies)

---

<div class="post-metadata">

**Author:** ![lolcode](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/lolcode/32/12928_2.png) [@lolcode](https://forum.mautic.org/u/lolcode)\
**Post date:** [September 8, 2025, 3:59pm UTC](https://forum.mautic.org/t/ddev-setup-with-composer-uploaded-images-etc-getting-added-to-git/36291/4 "2025-09-08T15:59:28Z")

</div>

I have also been thinking about this one a little since I posted it.

If composer is the recommended way to create a new install I think we may have this backwards. A .gitignore file is provided with Mautic no matter the download method but right now it only works with the distribution download?

1. git checkout - Target audience = core developers mainly. A .gitignore file would be nice but the audience is expected to be able to manage.

2. composer install - Target audience = integrators, consultancies, ambitious self-hosters, larger internal IT groups. A preset .gitignore file is desired to manage the install using devops principles unless an alternate is suggested. EG. perhaps a Makefile

3. Distribution download - Target audience = end users, small business/one person shops etc. No gitignore file is needed.

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [September 9, 2025, 8:45am UTC](https://forum.mautic.org/t/ddev-setup-with-composer-uploaded-images-etc-getting-added-to-git/36291/5 "2025-09-09T08:45:09Z")

</div>

Hmm, in that case all you need to add to Git is composer.json, perhaps composer.lock, right? So do you need to ignore the whole Mautic? Perhaps create a PR with the changes you need in the .gitignore so we can see what you are proposing but I’m afraid it will conflict with the changes needed for development.

I’d think that in this age the preferred way how to install Mautic is [GitHub - mautic/docker-mautic: Docker Image for Mautic](https://github.com/mautic/docker-mautic). I’m trying to build a CI/CD [repo](https://github.com/escopecz/docker-compose-mautic) where it would track changes and directly deploy the plugins and themes directly to a VPS. Take a look if it is something that would suite your needs. Perhaps we could join forces to make it bulletproof.
