As Woocommerce already includes a geolocation IP via WC_Geolocation
Class, that will allow you to get and set user geolocated country as default checkout country. There is no need of any additional plugin.
Note: WooCommerce allows shop owners to automatically geolocate customers and display tax rates and shipping methods specific to a customer’s location. In order to determine the correct location for a customer, as of version 3.9+, WooCommerce uses an integration with MaxMind Geolocation (and it is completely free to get a GeoIP Lite 2 license).

The code that will set by default the geolocated IP user country in checkout:
add_action( 'default_checkout_country' , 'set_user_geoip_country_as_default_checkout_country', 900 );
function set_user_geoip_country_as_default_checkout_country( $default_country ) {
// Get an instance of the WC_Geolocation object class
$geolocation = new WC_Geolocation();
// Get user IP
$user_ip_address = $geolocation->get_ip_address();
// Get user geolocated data.
$user_geoip_data = $geolocation->geolocate_ip( $user_ip_address );
if ( isset($user_geoip_data['country']) && ! empty($user_geoip_data['country']) ) {
$default_country = $user_geoip_data['country']; // Set user geoIp country
}
return $default_country;
}
If you want to do the same for checkout State field, you will use additionally the following:
add_action( 'default_checkout_state' , 'set_user_geoip_state_as_default_checkout_state' );
function set_user_geoip_state_as_default_checkout_state( $default_state ) {
// Get an instance of the WC_Geolocation object class
$geolocation = new WC_Geolocation();
// Get user IP
$user_ip_address = $geolocation->get_ip_address();
// Get user geolocated data.
$user_geoip_data = $geolocation->geolocate_ip( $user_ip_address );
if ( isset($user_geoip_data['state']) && ! empty($user_geoip_data['state']) ) {
$default_state = $user_geoip_data['state']; // Set user geoIp State
}
return $default_state;
}
Code goes in function.php file of your active child theme (or active theme). Tested and works.
Related: