This page provides two methods for automatically updating GeoIP2 and GeoIP Legacy Databases.
Using GeoIP Update
MaxMind provides the GeoIP Update program, which performs automatic updates for both GeoIP2 and GeoIP Legacy binary databases. GeoIP updates require an active GeoIP subscription. Please follow the instructions below.
Step 1 – Install GeoIP Update
Install GeoIP Update. The latest release may be downloaded from GitHub Releases.
Step 2 – Obtain GeoIP.conf with Account Information
For Paid GeoIP2 and GeoIP Legacy Databases
Get a pre-filled configuration file (may require authentication) and save it your configuration directory (e.g.,
You may also write this file by hand using the template below (not recommended).
# GeoIP.conf file - used by geoipupdate program to update databases # from http://www.maxmind.com UserId YOUR_USER_ID_HERE LicenseKey YOUR_LICENSE_KEY_HERE ProductIds YOUR_PRODUCT_IDS_HERE
For Free GeoLite2 and GeoLite Legacy Databases
The GeoIP Update program will also work without an account to retrieve the GeoLite databases. Please use the following
# The following UserId and LicenseKey are required placeholders: UserId 999999 LicenseKey 000000000000 # Include one or more of the following ProductIds: # * GeoLite2-City - GeoLite 2 City # * GeoLite2-Country - GeoLite2 Country # * GeoLite-Legacy-IPv6-City - GeoLite Legacy IPv6 City # * GeoLite-Legacy-IPv6-Country - GeoLite Legacy IPv6 Country # * 506 - GeoLite Legacy Country # * 517 - GeoLite Legacy ASN # * 533 - GeoLite Legacy City ProductIds GeoLite2-City GeoLite2-Country GeoLite-Legacy-IPv6-City GeoLite-Legacy-IPv6-Country 506 517 533
Step 3 – Run GeoIP Update
geoipupdate. To fully automate this process on Linux or Unix, use a crontab file like:
# top of crontab MAILTOfirstname.lastname@example.org 42 1 * * 6 /usr/local/bin/geoipupdate # end of crontab
This crontab file would run every week, and it would email you the results. To apply the crontab file run:
$ crontab cronfile
If you are running a firewall, geoipupdate requires that the DNS and HTTPS (443) ports be open.
This is only recommended for systems unable to use GeoIP Update, such as Windows.
In order to download the databases from a script or program, please use the “direct download URL” on our GeoIP download page. If you are using using
curl from a shell script, please be sure to quote the URL.