Would you like to learn how to perform the GeoIP database installation on Ubuntu Linux? In this tutorial, we are going to configure the GeoIP2 database on a computer running Ubuntu Linux.

• Ubuntu 18
• Ubuntu 19
• Ubuntu 20

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Tutorial Ubuntu - GEOIP2 database installation

Access the MAXMIND website and create a new account.

Access your account profile and create a new key.

Nginx - GeoIP2 key

Add the MAXMIND repository to your Ubuntu Linux.

Copy to Clipboard

Install the package named GEOIPUPDATE.

Copy to Clipboard

Edit the GEOIPUPDATE configuration file.

Copy to Clipboard

Insert your account ID and license key.

Here is the file, before our configuration.

Copy to Clipboard

Here is the file, after our configuration.

Copy to Clipboard

Update the database of GEOIP2.

Copy to Clipboard

Verify the GEOIP2 database installation.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

You installed the GEOIP2 database for countries and cities.

Congratulations! You have finished the installation of GEOIPUPDATE.

Tutorial GEOIP2 - IP address verification

Install the package named MMDB-BIN.

Copy to Clipboard

Verify the country of an IP address.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Verify the city of an IP address.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Verify the state of an IP address.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Verify the continent of an IP address.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Verify the latitude and the longitude of an IP address.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Congratulations! You are able to verify the Geolocation of the IP address using the command line on Linux.

Tutorial GEOIP2 - Database update

Create a scheduled task to update the GEOIP2 database.

Copy to Clipboard

Here is the file content.

Copy to Clipboard

Congratulations! You have configured the GEOIP2 database automatic update.