Here is how to detect user country from the IP address that cPanel displays on the right side of the Tools page, and add a flag representing that country.

1.) First download the flag icons of all countries here: https://flagpedia.net/download/

Create a new directory “flags” under Jupiter theme and add all flags there /usr/local/cpanel/base/frontend/jupiter/flags
We are going to use a free API: https://github.com/hakanensari/country and you don’t need any API key.
2.) Create a new file /var/cpanel/customizations/content_includes/cpanel_jupiter_footer_after.html.tt and add the following javascript code to it:
Save the file and test, you should see flag icon appear immediately.
In the provided code we make sure to convert the country code from the API to lowercase letters in order to match filenames of the icons, and also check if API response was successful – if not, to avoid broken images, no icon will be shown.


![node[175421]: pthread_create: Resource temporarily unavailable 2023 08 28 12 15 - node[175421]: pthread_create: Resource temporarily unavailable](https://i0.wp.com/administrator.pejcic.rs/wp-content/uploads/2023/08/2023-08-28_12-15.png?resize=344%2C194&ssl=1)
