The blood-brain barrier of Drosophila is established by surface glia, which ensheath the nerve cord and insulate it against the potassium-rich hemolymph by forming intercellular septate junctions. The mechanisms underlying the formation of this barrier remain obscure. Here, we show that the G protein-coupled receptor (GPCR) Moody, the G protein subunits G alpha i and G alpha o, and the regulator of G protein signaling Loco are required in the surface glia to achieve effective insulation. Our data suggest that the four proteins act in a complex common pathway. At the cellular level, the components function by regulating the cortical actin and thereby stabilizing the extended morphology of the surface glia, which in turn is necessary for the formation of septate junctions of sufficient length to achieve proper sealing of the nerve cord. Our study demonstrates the importance of morphogenetic regulation in blood-brain barrier development and places GPCR signaling at its core.