In the absence of complex communication and a global knowledge of the environment, cockroaches are able to assess the availability of resources and to reach a consensual decision: the group aggregates in a single resting site. We show that the aggregation dynamics and the collective shelter selection of cockroaches are influenced by their social context as, unlike single individuals, groups of cockroaches are more likely to respond to environmental heterogeneities. The decision of individuals to stay under a shelter relies on the modulation of their resting time, according to the perception of two local cues: (1) the shelters luminosity and (2) the number of congeners. This study on the cockroach species Periplaneta americana highlights a shelter-selection mechanism based on an amplification process resulting from the interactions between congeners. This mechanism leads to complex spatiotemporal aggregation dynamics characterized by transient bimodality, bifurcation patterns (shelter selection) and the existence of a quorum size in the settlement behaviour of the cockroaches. Finally, we discuss the generic aspect for other gregarious species of the collective decision-making process demonstrated for cockroaches.