Automated tool or method to install matomo with script, cli, or API.?

I’m trying to automate the 8 steps of the installation of matomo, especially the creation of tables in the database. I’m using matomo 4.14 installed on an ec2 instance, the database is mariadb, and it is installed on another ec2 with guaranteed communication between them. Is there any way to do it using a script or API?

Hi @kaylex
The tables installation should be automatic during Matomo installation (at first connection).

Hello @Philippe
thank you for your response
I just want to mention that this step of creating tables done by the UI, I need to simulate it by a script or API, what I actually did was that I finished manually the 8 steps of the installation (setting database credentials, creation tables…) and I dumbed sql queries from the database but I believe that this methode is not a good way to work with and it is not robust, I’m thinking of finding a way to use some API to simulate the installation steps done by the UI like this example https://gist.github.com/dsprenkels/5018719ad7fa2df237f035b502bbdddd

thank you for your response
Actually, I automated all of those steps, but I’m stuck on the creating tables step done by the UI. The temporary solution I found is to dump the sql code done automatically by the UI and reuse it, but I don’t think this is a good way to work and it is not robust in the future. I found this example of installer script https://gist.github.com/dsprenkels/5018719ad7fa2df237f035b502bbdddd to simulate the 8 steps done by the UI, but I’m having issues with the API call of the super user credentials. Could you please assist me?

Hi @kaylex
I don’t understand why you want to automate something already automated…
Normally, the tables creation can also be done thanks to the following command:

$ ./path/to/matomo/console core:update --yes

Hi Philippe,
I believe there is a misunderstanding. I finally discovered a technique to automate the eight phases of the ui installation using api calls, however I don’t believe the core update will fail in this instance. following this https://gist.github.com/dsprenkels/5018719ad7fa2df237f035b502bbd

1 Like