
Over the new year I got a PHP error from my Matomo crontask regarding GeoIP2 database from Maxmind. The error message is:
1 2 |
GeoIP2AutoUpdater: failed to download 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz' curl_exec: Could not resolve host: geolite.maxmind.com. Hostname requested was: geolite.maxmind.com |
After short time googling, I found out that Maxmind doesn’t allow anonymous download of their free GeoIP2 databases because of a California Consumer Privacy Act (CCPA). See source
In short you have to create an account and get a license key to be able to download the GeoIP2 database. Following need to be done:
- Create a free Maxmind account here
- Get a license key here
- Create a download link based on the needed database file. See here
For city database for matomo you can use this link. Just add your license keyhttps://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&suffix=tar.gz&license_key=YOUR_LICENSE_KEY
- Put the link in the Matomo geolocation settings page.