The lipid phosphatidylinositol-3-phosphate (PI3P) is a regulator of two fundamental but distinct cellular processes, endocytosis and autophagy, so its generation needs to be under precise temporal and spatial control. PI3P is generated by two complexes that both contain the lipid kinase VPS34: complex II on endosomes (VPS34/VPS15/Beclin 1/UVRAG), and complex I on autophagosomes (VPS34/VPS15/Beclin 1/ATG14L). The endosomal GTPase Rab5 binds complex II, but the mechanism of VPS34 activation by Rab5 has remained elusive, and no GTPase is known to bind complex I. Here we show that Rab5a–GTP recruits endocytic complex II to membranes and activates it by binding between the VPS34 C2 and VPS15 WD40 domains. Electron cryotomography of complex II on Rab5a-decorated vesicles shows that the VPS34 kinase domain is released from inhibition by VPS15 and hovers over the lipid bilayer, poised for catalysis. We also show that the GTPase Rab1a, which is known to be involved in autophagy, recruits and activates the autophagy-specific complex I, but not complex II. Both Rabs bind to the same VPS34 interface but in a manner unique for each. These findings reveal how VPS34 complexes are activated on membranes by specific Rab GTPases and how they are recruited to unique cellular locations.