{"id":13618125,"url":"https://github.com/crazy-max/docker-matomo","last_synced_at":"2026-03-08T01:17:28.161Z","repository":{"id":28424294,"uuid":"118130706","full_name":"crazy-max/docker-matomo","owner":"crazy-max","description":"Matomo (formerly Piwik) Docker image","archived":false,"fork":false,"pushed_at":"2024-09-11T09:25:52.000Z","size":722,"stargazers_count":170,"open_issues_count":5,"forks_count":43,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-18T07:32:29.057Z","etag":null,"topics":["alpine-linux","analytics","docker","matomo","nginx","piwik"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crazy-max.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"crazy-max","custom":"https://www.paypal.me/crazyws"}},"created_at":"2018-01-19T13:50:46.000Z","updated_at":"2024-09-11T09:25:14.000Z","dependencies_parsed_at":"2023-11-25T22:25:35.437Z","dependency_job_id":"732d171a-cf1b-4405-9dee-91761c65b2fd","html_url":"https://github.com/crazy-max/docker-matomo","commit_stats":null,"previous_names":[],"tags_count":105,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fdocker-matomo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fdocker-matomo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fdocker-matomo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fdocker-matomo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crazy-max","download_url":"https://codeload.github.com/crazy-max/docker-matomo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247666015,"owners_count":20975788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpine-linux","analytics","docker","matomo","nginx","piwik"],"created_at":"2024-08-01T20:01:54.895Z","updated_at":"2026-03-08T01:17:28.112Z","avatar_url":"https://github.com/crazy-max.png","language":"Dockerfile","readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/crazy-max/docker-matomo\" target=\"_blank\"\u003e\u003cimg height=\"128\" src=\"https://raw.githubusercontent.com/crazy-max/docker-matomo/master/.github/docker-matomo.jpg\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://hub.docker.com/r/crazymax/matomo/tags?page=1\u0026ordering=last_updated\"\u003e\u003cimg src=\"https://img.shields.io/github/v/tag/crazy-max/docker-matomo?label=version\u0026style=flat-square\" alt=\"Latest Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/crazy-max/docker-matomo/actions?workflow=build\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/crazy-max/docker-matomo/build.yml?branch=master\u0026label=build\u0026logo=github\u0026style=flat-square\" alt=\"Build Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://hub.docker.com/r/crazymax/matomo/\"\u003e\u003cimg src=\"https://img.shields.io/docker/stars/crazymax/matomo.svg?style=flat-square\u0026logo=docker\" alt=\"Docker Stars\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://hub.docker.com/r/crazymax/matomo/\"\u003e\u003cimg src=\"https://img.shields.io/docker/pulls/crazymax/matomo.svg?style=flat-square\u0026logo=docker\" alt=\"Docker Pulls\"\u003e\u003c/a\u003e\n  \u003cbr /\u003e\u003ca href=\"https://github.com/sponsors/crazy-max\"\u003e\u003cimg src=\"https://img.shields.io/badge/sponsor-crazy--max-181717.svg?logo=github\u0026style=flat-square\" alt=\"Become a sponsor\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.paypal.me/crazyws\"\u003e\u003cimg src=\"https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal\u0026style=flat-square\" alt=\"Donate Paypal\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## About\n\n[Matomo](https://matomo.org/) (formerly Piwik) Docker image.\n\n\u003e [!TIP] \n\u003e Want to be notified of new releases? Check out 🔔 [Diun (Docker Image Update Notifier)](https://github.com/crazy-max/diun)\n\u003e project!\n\n___\n\n* [Features](#features)\n* [Build locally](#build-locally)\n* [Image](#image)\n* [Environment variables](#environment-variables)\n* [Volumes](#volumes)\n* [Ports](#ports)\n* [Usage](#usage)\n  * [Docker Compose](#docker-compose)\n  * [Swarm](#swarm)\n  * [Kubernetes](#kubernetes)\n  * [Command line](#command-line)\n* [Upgrade](#upgrade)\n* [Notes](#notes)\n  * [Console command](#console-command)\n  * [Email server settings](#email-server-settings)\n  * [Sticky sessions](#sticky-sessions)\n  * [Cron](#cron)\n  * [GeoIP2](#geoip2)\n  * [Behind a reverse proxy?](#behind-a-reverse-proxy)\n  * [Redis cache](#redis-cache)\n  * [Plugins](#plugins)\n* [Contributing](#contributing)\n* [License](#license)\n\n## Features\n\n* Run as non-root user\n* Multi-platform image\n* Config, plugins and user preferences in the same folder\n* Unifont for languages using [unicode characters](https://matomo.org/faq/how-to-install/faq_142/)\n* Cron tasks to archive Matomo reports as a [\"sidecar\" container](#cron)\n* Ability to pass [additional options](https://matomo.org/docs/setup-auto-archiving/#help-for-corearchive-command) during cron archive\n* Plugins and config are kept across upgrades of this image\n* OPCache enabled to store precompiled script bytecode in shared memory\n* Redis enabled and ready to enhance server performance\n* [s6-overlay](https://github.com/just-containers/s6-overlay/) as process supervisor\n* [Traefik](https://github.com/containous/traefik-library-image) as reverse proxy and creation/renewal of Let's Encrypt certificates (see [this template](examples/traefik))\n* [msmtpd SMTP relay](https://github.com/crazy-max/docker-msmtpd) image to send emails\n* [Redis](https://github.com/docker-library/redis) Docker image ready to use as [Redis cache](https://matomo.org/faq/how-to/faq_20511/) or [QueuedTracking plugin](https://matomo.org/faq/how-to/faq_19738) for better scalability\n* [MariaDB](https://github.com/docker-library/mariadb) Docker image as database instance\n* [geoip-updater](https://github.com/crazy-max/geoip-updater) Docker image to download MaxMind's GeoIP2 databases on a time-based schedule for geolocation\n* Cron jobs as a [\"sidecar\" container](#cron)\n\n## Build locally\n\n```shell\ngit clone https://github.com/crazy-max/docker-matomo.git\ncd docker-matomo\n\n# Build image and output to docker (default)\ndocker buildx bake\n\n# Build multi-platform image\ndocker buildx bake image-all\n```\n\n## Image\n\n| Registry                                                                                          | Image                      |\n|---------------------------------------------------------------------------------------------------|----------------------------|\n| [Docker Hub](https://hub.docker.com/r/crazymax/matomo/)                                           | `crazymax/matomo`          |\n| [GitHub Container Registry](https://github.com/users/crazy-max/packages/container/package/matomo) | `ghcr.io/crazy-max/matomo` |\n\nFollowing platforms for this image are available:\n\n```\n$ docker buildx imagetools inspect crazymax/matomo --format \"{{json .Manifest}}\" | \\\n  jq -r '.manifests[] | select(.platform.os != null and .platform.os != \"unknown\") | .platform | \"\\(.os)/\\(.architecture)\\(if .variant then \"/\" + .variant else \"\" end)\"'\n\nlinux/386\nlinux/amd64\nlinux/arm/v6\nlinux/arm/v7\nlinux/arm64\nlinux/ppc64le\nlinux/riscv64\nlinux/s390x\n```\n\n## Environment variables\n\n* `TZ`: The timezone assigned to the container (default `UTC`)\n* `PUID`: Matomo user id (default `1000`)\n* `PGID`: Matomo group id (default `1000`)\n* `MEMORY_LIMIT`: PHP memory limit (default `256M`)\n* `UPLOAD_MAX_SIZE`: Upload max size (default `16M`)\n* `CLEAR_ENV`: Clear environment in FPM workers (default `yes`)\n* `OPCACHE_MEM_SIZE`: PHP OpCache memory consumption (default `128`)\n* `LISTEN_IPV6`: Enable IPv6 for Nginx (default `true`)\n* `REAL_IP_FROM`: Trusted addresses that are known to send correct replacement addresses (default `0.0.0.0/32`)\n* `REAL_IP_HEADER`: Request header field whose value will be used to replace the client address (default `X-Forwarded-For`)\n* `LOG_IP_VAR`: Use another variable to retrieve the remote IP address for access [log_format](http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format) on Nginx. (default `remote_addr`)\n* `LOG_LEVEL`: [Log level](https://matomo.org/faq/troubleshooting/faq_115/) of Matomo UI (default `WARN`)\n* `SHORTCODE_DOMAIN`: Domain that you use for [ShortcodeTracker plugin](https://plugins.matomo.org/shortcodetracker) (default `invalid`)\n\nThe following environment variables are only used if you run the container as [\"sidecar\" mode](#cron):\n\n* `SIDECAR_CRON`: Set to `1` to enable sidecar cron mode (default `0`)\n* `ARCHIVE_OPTIONS`: Pass [additional options](https://matomo.org/docs/setup-auto-archiving/#help-for-corearchive-command) during cron archive\n* `CRON_ARCHIVE`: Periodically execute Matomo [archive](https://matomo.org/docs/setup-auto-archiving/#linuxunix-how-to-set-up-a-crontab-to-automatically-archive-the-reports) (disabled if empty ; ex `0 * * * *`)\n\n## Volumes\n\n* `/data`: Contains GeoIP2 databases, configuration, installed plugins (not core ones), tmp and user folders to store\nyour [custom logo](https://matomo.org/faq/new-to-piwik/faq_129/)\n\n\u003e :warning: Note that the volume should be owned by the user/group with the specified `PUID` and `PGID`. If you\n\u003e don't give the volume correct permissions, the container may not start.\n\n## Ports\n\n* `8000`: HTTP port\n\n## Usage\n\n### Docker Compose\n\nDocker compose is the recommended way to run this image. Copy the content of folder [examples/compose](examples/compose)\nin `/var/matomo/` on your host for example. Edit the compose and env files with your preferences and run the following\ncommands:\n\n```shell\ndocker compose up -d\ndocker compose logs -f\n# open your browser at http://localhost:8000\n```\n\n### Swarm\n\nDeploy this image in your Swarm cluster. Detailed instructions [can be found here](examples/swarm).\n\n### Kubernetes\n\nDeploy this image in your kubernetes cluster. Detailed instructions [can be found here](examples/kubernetes).\n\n### Command line\n\nYou can also use the following minimal command:\n\n```shell\ndocker run -d -p 8000:8000 --name matomo \\\n  -v $(pwd)/data:/data \\\n  crazymax/matomo:latest\n```\n\n\u003e:warning: You will need to have your own database server to connect to as this only runs Matomo.\n\n## Upgrade\n\nYou can upgrade Matomo automatically through the UI, it works well. But I recommend to recreate the container\nwhenever I push an update:\n\n```shell\ndocker compose pull\ndocker compose up -d\n```\n\n## Notes\n\n### Console command\n\nIf you want to use the `console` command to perform common server operations, type:\n\n```shell\ndocker compose exec matomo console\n```\n\n### Email server settings\n\nYou can use our SMTP relay `msmtpd` service published on port `2500` and\ndeclared in the [`compose.yml`](examples/compose/compose.yml):\n\n![Email server settings](.github/email-server-settings.png)\n\n### Sticky sessions\n\nOn a HA environment, **enable backend sticky sessions** on your load balancer.\n\n### Cron\n\nIf you want to enable the cron job, you have to run a \"sidecar\" container like in the\n[compose file](examples/compose/compose.yml) or run a simple container like this:\n\n```bash\ndocker run -d --name matomo_cron \\\n  --env-file $(pwd)/matomo.env \\\n  --no-healthcheck \\\n  -e \"SIDECAR_CRON=1\" \\\n  -e \"CRON_ARCHIVE=0 * * * *\" \\\n  -e \"ARCHIVE_OPTIONS=--concurrent-requests-per-website=3\" \\\n  -v $(pwd)/data:/data \\\n  crazymax/matomo:latest\n```\n\nThen if you have enabled `CRON_ARCHIVE` to automatically archive the reports, you have to disable Matomo archiving\nto trigger from the browser. Go to **System \u003e General settings**:\n\n![Disable Matomo archiving from browser](.github/disable-archive-reports-browser.png)\n\n### GeoIP2\n\nThis image already uses GeoIP2 databases of [MaxMind](https://www.maxmind.com/) with their PHP extension\nand are updated with [geoip-updater](https://github.com/crazy-max/geoip-updater). You just have to install\nand activate the [GeoIP 2 plugin](https://plugins.matomo.org/GeoIP2).\n\nAlso make sure to select **DBIP / GeoIP 2 (Php)** in **System \u003e Geolocation**:\n\n![DBIP / GeoIP 2 (Php)](.github/geoip2-dbip-php.jpg)\n\n### Behind a reverse proxy?\n\nIf you are running Matomo [behind a reverse proxy](https://matomo.org/faq/how-to-install/faq_98/), add this to your\nconfig.ini.php:\n\n```\n[General]\nassume_secure_protocol = 1 # 0=http 1=https\nproxy_client_headers[] = HTTP_X_FORWARDED_FOR\nproxy_client_headers[] = HTTP_X_REAL_IP\nproxy_host_headers[] = HTTP_X_FORWARDED_HOST\n```\n\n### Redis cache\n\nTo use [Redis as a cache](https://matomo.org/faq/how-to/faq_20511/) (useful if your Matomo environment consists of\nmultiple servers), add this to your config.ini.php:\n\n```\n[Cache]\nbackend = chained\n\n[ChainedCache]\nbackends[] = array\nbackends[] = redis\n\n[RedisCache]\nhost = \"redis\" # Docker service name for Redis \nport = 6379\ntimeout = 0.0\npassword = \"\"\ndatabase = 14\n```\n\nIn case you are using queued tracking: Make sure to configure a different database! Otherwise queued requests will\nbe flushed.\n\n### Plugins\n\nIf you are on a [HA environment](https://matomo.org/faq/new-to-piwik/faq_134/), there is no need to set\n`multi_server_environment = 1` in your config.\n\n## Contributing\n\nWant to contribute? Awesome! The most basic way to show your support is to star\nthe project, or to raise issues. You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max)\nor by making a [PayPal donation](https://www.paypal.me/crazyws) to ensure this\njourney continues indefinitely!\n\nThanks again for your support, it is much appreciated! :pray:\n\n## License\n\nMIT. See `LICENSE` for more details.\n","funding_links":["https://github.com/sponsors/crazy-max","https://www.paypal.me/crazyws"],"categories":["HarmonyOS","Dockerfile"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazy-max%2Fdocker-matomo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazy-max%2Fdocker-matomo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazy-max%2Fdocker-matomo/lists"}