How to download GeoLite2-City.mmdb.gz file for PrestaShop ?

In order to use Geolocation tools in PrestaShop 1.7 you need to download and unpack  GeoLite2-City.mmdb.gz file into the /app/Resources/geoip/ directory. Unfortunately - since 30 December 2019 this file is not available to download anymore(before 30 December 2019 it was possible to download it without any additional steps - file was available to download directly by link).

 

GeoLite2-City.mmdb.gz file - what it contains?

GeoLite2-City database created by MaxMind.com contains thousands of records with information about ip-country and even ip-city associations. Thanks to this file - in context of PrestaShop - we will be able to identify customers' origin. The way the IP-based geolocation works is simply by checking which IP range is used by which area, using an IP-to-location database. So, you can find the information like the country and the city that your users come from, just by knowing their IP address.

 

How to download GeoLite2-City.mmdb.gz for PrestaShop ?

As I already mentioned this file is still accessible for free - even for commercial projects - but it requires some additional steps before you will be able to download it. Below you can find detailed instructions.

  1. Create an account on maxmind.com website
    Open signup to maxmind website. Register process is absolutely free . So you do not have to worry that you will pay something. You need to use valid email address - because maxmind requires email verification.
    Regarding to the rest of user details - you can even fill out the form with fake details, but I do not suggest it - your account can be deleted so in the future you will not be able to download updates of GeoLite2-city database.
    maxmind register account
  2. Confirm your email address
    You will receive an email from maxmind. Click on link attached to email. You will be redirected to maxmind page where you can setup your account password.

  3. Login to your maxmind user account
    Your email address is your username, password you set in previous step. So you can log in to your maxmind account.
    Left hand side column has section "GeoIP2 / GeoLite2" section. Click there on "Download files" menu item.
    You will be redirected to page "Download GeoIP2 and GeoIP legancy databases". There is a subsection "Download databases" where you can find link to GeoLite2-City file. Please make sure that you clcik on download link near the GeoLite2-City (not: GeoLite2-City_CSV - it is very important)

    geolite2-city download - for prestashop geolocation

 

That's all. You can unpack downloaded file and move the GeoLite2-City.mmdb.gz file into the /app/Resources/geoip/ directory. Thanks to this you will be able to use geolocation in prestashop 1.7 and in our modules like:


If you are looking for Geoliation for old PS releases, check this: GeoLiteCity.dat for PrestaShop 1.6.x

author milos myszczuk
Article by Milosz Myszczuk PrestaShop expert, official PrestaShop community moderator. PHP developer, specialist in relative and spatial databases management, GIS Analyst, CEO & founder of VEKIA interactive agency. Read more about VEKIA company
If you like my articles and want much more valuable tips, feel free to send me donation
1.4 version 1.4.11 1.6 404 addon admin advertise ahref ajax alpha animation api app application authentication back office backup badge banner basics block bootstrap button cache carrier cart catalog category certificate changelog chat class clear client clip cms code colors columns comments configuration contact container content controller cookie counter country coupon css csv currency customer dashboard database debug default delete delivery desktop developer device disable discount displayNav displayTop download dynamic editor effect empty encrypt engine error exchange exclude export facebook faceshop fade fancoupon fancybox fanpage fatal feature feed field file fix fixed font footer free friendly url front ftp full gallery generate gift global godaddy google google+ gray grid groupon header help hide highlight homefeatured homepage hook hosting hover howto htaccess html html5 ID image import include input instagram installation integration iPhone issue javascript jquery kgb knowhow languages law left likebox link list livingsocial loading log login logo loyality mail mailing maintenance manufacturer marketing marquee mcrypt menu meta mobile modification module movie moving multilanguage multiupload must have mysql news newsletter notification number open graph order override page password performance PHP phpmyadmin picture pinterest plugin popup post prestashop prestashop 1.0 prestashop 1.1 prestashop 1.2 prestashop 1.3 prestashop 1.4 prestashop 1.5 price rules problem product profile promotion proslider purifier quantity query quick tip random rates register reinsurance release reporting reset responsive restore results ribbon rich text right sales search security seo service shadow share shipping shop shopmania slider smarty social networks SQL SSL statistics stock store style subcategory superuser support switcher tab tablet tag tax template text theme tinyMCE tips and tricks tpl tracking translations tree trends trigger tumblr tutorial twitter update upgrade upload variables video visits voucher vulnerability web2print wide widget width window wishlist wysiwyg youtube zip zopim