Studies of biodiversity along environmental gradients provide information on how ecological communities change in response to biotic and abiotic factors. For instance, distance to water is associated with several factors that shape the structure and the functioning of ecosystems at a range of spatial scales. We investigated the influence of distance to a perennial water source on ant communities in a semi‐arid savanna in northern Botswana. Ant abundance, taxonomic richness, and both alpha and beta diversity were generally higher during the wet than the dry season. However, there were strong seasonal influences on the effects of distance to water, with more pronounced effects during the wet season. While both abundance and beta diversity declined with increasing distances to water during the wet season, there was a contrasting increase in alpha diversity. There was no major effect of distance to water on taxonomic richness during either season. Beta diversity was as high across as along gradients, and we found support for modular rather than nested community structures along gradients. Our study demonstrated that small‐scale gradients in distance to water can influence several aspects of ant communities in semi‐arid savannas. However, our results also point to strong effects of small‐scale environmental variation, for instance associated with vegetation characteristics, soil properties, and plant community structure that are not directly linked to water access.