Automatic Updates for GeoIP2 and GeoIP Legacy Databases

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

Get a pre-filled configuration file (may require authentication) and save it your configuration directory (e.g., /usr/local/etc/) as GeoIP.conf.

You may also write this file by hand using the template below (not recommended).

Step 3 – Run GeoIP Update

Run geoipupdate. To fully automate this process on Linux or Unix, use a crontab file like:

This crontab file would run every Wednesday at noon, and it would email you the results. To apply the crontab file run:

If you are running a firewall, geoipupdate requires that the DNS and HTTPS (443) ports be open.

Direct Downloads

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 wget or curl from a shell script, please be sure to quote the URL.

This download will return a compressed file in gzip format, which can be uncompressed using a program like 7-Zip or gzip.