Advertising sustains the DA. Ads are hidden for members. Join today

On this page

Local Matomo instance

Last updated on
2 December 2024

This documentation needs work. See "Help improve this page" in the sidebar.

If you need to run Matomo locally for development and testing, you can create a local instance with any of these methods.

DDEV

You can use unofficial ddev plugin or perform the manual steps:

To add custom configuration or additional services to your project, create docker-compose files in the its .ddev directory. DDEV will process any files with the docker-compose.[servicename].yaml naming convention and include them in executing docker-compose functionality.

To add a Matomo instance to a DDEV project, you can create the following file : .ddev/docker-compose.matomo.yaml and defining the service by copy pasting the example below:

version: "3"

services:
  matomo:
    image: matomo
    restart: always
    volumes:
      - matomo:/var/www/html
    environment:
      - MATOMO_DATABASE_HOST=db
    # env_file:
    #   - ./db.env
    ports:
      - 8080:80

volumes:
  matomo:

Lando

Download latest version of Matomo, unzip it and create a Lando instance:

wget https://builds.matomo.org/matomo.zip
unzip matomo.zip
cd matomo
lando init --source cwd --recipe lamp --webroot . --name matomo
lando start

After that you can install Matomo via the browser from https://matomo.lndo.site/

On the Database Setup page, use these values:

  • Database Server: database (from 127.0.0.1)
  • Login: lamp
  • Password: lamp
  • Database Name: lamp

Docker Matomo

You can use the official Matomo Docker image.

A setup with Docker Compose can be found on this repository it will require to use Traefik as a reverse-proxy.

The Matomo instance will be accessible on https://matomo.docker.localhost

Here is an example of Drupal in Docker that can contact this Matomo instance.

Help improve this page

Page status: Needs work

You can: