The reliance on visual cues can vary among ant species living in different habitats, and is mostly influenced by the level of ambient illumination and the morphological adaptations of ant species that can determine their period of daily activity. Thus, different illumination regimes might affect ant community composition in habitats with different ambient illumination intensities. Despite this, in the literature, information is scarce about the effects of ambient illumination on ant activity. In the present study, we investigated the effect of ambient illumination intensity on the activity of ant species and their community composition under herbaceous and woody plants in 24 localities from Kyiv and Kyiv region, Ukraine. Our results showed that the ambient illumination properties of the habitat type affect the presence of ant species and the activity of their workers. In open habitats, the maximum ambient illumination had a negative effect, whereas in closed, woody habitats the maximum ambient illumination and tree circumference generally had a positive effect on the number of non-dendrobiotic ant individuals found on individual plants. The dendrobiotic species were less affected by the maximum illumination intensity. Although, in closed habitats, the effect of the previous variables and their interaction had species-specific aspects. Based on the former, we can tell that more structured forest habitats can provide broader illumination intensity ranges, allowing more ant species to coexist. However, similar illumination intensity ranges can lead to overlaps in the activity of ant species under the same illumination conditions, especially in open habitats. The outcomes of these interactions are highly influenced by larger trees that besides lowering illumination intensities, can enhance ant worker activity and promote species coexistence.