AbstractPatterns of gall‐inducing insect diversity tend to be influenced by both habitat‐related and plant‐related characteristics. We investigated the distribution patterns of galling insects in four vegetation types (terra firme forest, white‐sand dry forest, white‐sand wet forest and palm swamp forest) of the Peruvian Amazon to test if the insect gall diversity (1) differs among different types of vegetation and (2) depends on host plant richness. In total, we found 11,579 galls belonging to 249 insect gall morphotypes, distributed across 30 botanical families and 75 plant species. Among host plant families, Fabaceae showed the greatest richness of insect gall morphotypes. We found that galling species richness was lower in palm swamp forest than in white‐sand forests, which can be explained by the lower richness of plants in this type of vegetation. However, we found no evidence of greater richness in xeric habitats (e.g., white‐sand dry forest) than in more mesic vegetation (terra firme forest), contradicting the hypothesis of hygrothermal stress. We also found that plant species richness was positively influenced with the richness and abundance of galling species, regardless of vegetation type. Galling insect species composition differed significantly between vegetation types, similarly to the floristic composition. Our findings show that the diversity of galling insects in the tropical rainforests of Peruvian Amazon are mainly influenced by host plant composition and host plant richness.Abstract in Spanish is available with online material.