Local adaptation of animals to the environment can abruptly become a burden when faced with rapid climatic changes such as those foreseen for the Italian peninsula over the next 70 years. Our study investigates the genetic structure of the Italian goat populations and links it with the environment and how genetics might evolve over the next 50 years. We used one of the largest national datasets including > 1000 goats from 33 populations across the Italian peninsula collected by the Italian Goat Consortium and genotyped with over 50 k markers. Our results showed that Italian goats can be discriminated in three groups reflective of the Italian geography and its geo-political situation preceding the country unification around two centuries ago. We leveraged the remarkable genetic and geographical diversity of the Italian goat populations and performed landscape genomics analysis to disentangle the relationship between genotype and environment, finding 64 SNPs intercepting genomic regions linked to growth, circadian rhythm, fertility, and inflammatory response. Lastly, we calculated the hypothetical future genotypic frequencies of the most relevant SNPs identified through landscape genomics to evaluate their long-term effect on the genetic structure of the Italian goat populations. Our results provide an insight into the past and the future of the Italian local goat populations, helping the institutions in defining new conservation strategy plans that could preserve their diversity and their link to local realities challenged by climate change.