Animal and human dirofilariosis is a vector-borne zoonotic disease, being one of the most important diseases in Europe. In Serbia, there are extensive studies reporting the presence of Dirofilaria immitis and D. repens, mainly in the north of the country, where the human population is concentrated and where there is a presence of culicid mosquitoes that transmit the disease. Ecological niche modeling (ENM) has proven to be a very good tool to predict the appearance of parasitosis in very diverse areas, with distant orography and climatologies at a local, continental, and global level. Taking these factors into account, the objective of this study was to develop an environmental model for Serbia that reflects the suitability of the ecological niche for the risk of infection with Dirofilaria spp. with which the predictive power of existing studies is improved. A wide set of variables related to the transmission of the parasite were used. The potential number of generations of D. immitis and the ecological niche modeling method (ENM) were used to estimate the potential distribution of suitable habitats for Culex pipiens. The highest probability of infection risk was located in the north of the country, and the lowest in the southern regions, where there is more orographic relief and less human activity. The model was corroborated with the location of D. immitis-infected dogs, with 89.28% of the country having a high probability of infection. In addition, it was observed that the percentage of territory with optimal habitat for Culex spp. will increase significantly between now and 2080. This new model can be used as a tool in the control and prevention of heartworm disease in Serbia, due to its high predictive power, and will serve to alert veterinary and health personnel of the presence of the disease in the animal and human population, respectively.