The GeoIP databases are sold by MaxMind. MaxMind sells different databases, each with different amounts and types of information.

The country, region and city databases can be used to determine the location of an IP address with different amounts granularity:

  • The country database can only tell you the country of an IP address.
  • The region database can tell you the region and the country.
  • And, the city database can tell you the country, region, city, postal code, geographic coordinates (latitude/longitude) and area code of an IP address.

The ISP and Organization databases can be used to determine the ISP and company of an IP address.

You can find more information on the commercial databases here.

MaxMind also provides two free databases that are less accurate than the commercial ones. One of the free databases can only be used to determine an IP address’ country. The other, called GeoLite City, can be used to determine the same information as the commercial city database.

Needless to say, we recommend using one of the city databases.

Piwik includes a tool that will download the GeoLiteCity database for you. You can access the tool by navigating to Settings > Geolocation.

If you want to install the database by hand, you can download each of the free databases here. Make sure to download the binary versions of the databases.

Keep in mind that geolocation data will eventually become out of date. It is recommended you update your databases at least once a month.* The free databases are updated once a month on the first Tuesday.

Note: The latest version of Piwik includes an auto-updater for the GeoIP databases.

If you are installing the databases manually, then once you get the database you want to use copy it to Piwik’s path/to/piwik/misc/ subdirectory. If you’re using the GeoLite City database, make sure you rename it from

GeoLiteCity.dat

to

GeoIPCity.dat

This will help you avoid some potential problems.