Group-living organisms offer a unique perspective on how environmental gradients influence geographic distributions, as not only the properties of individuals, but also those of their groups interact with the environment to determine a species range. In turn, the ranges of group-living organisms should provide insights on the conditions that favor group versus solitary living. Here we show that rain intensity and predation by ants, factors postulated to exclude subsocial Anelosimus spiders from the lowland tropical rainforest, are greater in this habitat than at higher elevations. We further show that experimentally excluding these factors increases the survival of subsocial Anelosimus colonies when transplanted to the lowland rainforest, but not at their native higher elevation range. While providing a rare experimental test of the simultaneous importance of abiotic and biotic gradients on species range limits, these results provide direct evidence that adverse environmental factors may prevent solitary living and require group living in certain environments.