How to install with a pre-configuration of config.ini.php

Using a Dockerfile configuration I would like to pre-configure the installation with information such as the database server, name port etc but without the username and password. As well as other information such as the local Super User name and password.

I see that if config.ini.php exists in any way but does not have the complete database information then an MYSQL error is thrown when initializing Matomo. I have found that putting anything in this file before the DB configuration is pointless.

I have tried to use EnvironmentVariables plugin but this plugin needs to be activated beforehand, which has to be done after the installation is complete.

Can anyone give an example on how to use this plugin correctly or how to configure the config.ini.php file during the deployment stage?

Thanks for any feedback


I am not too familiar with this use-case, but you might want to look at which allow automated Matomo installs from the commandline.

Thanks for your reply.Extratools looks like the way to go for a configured installation. But don’t you need a configured database already in order to install the this plugin? If not does someone have an example for how to get this plugin installed from in a docker image?

Hi peter,

have you seen this file which seems to replicate the config.ini.php- seems to have all the necessary db details you need to fill in