Primary immunodeficiencies (PIDs) are inherited disorders of the immune system, associated with a considerable increase in susceptibility to infections. PIDs can also predispose to malignancy, inflammation and autoimmunity. There is increasing awareness that some aspects of the immune dysregulation in PIDs may be linked to intestinal microbiota. Indeed, the gut microbiota and its metabolites have been shown to influence immune functions and immune homeostasis both locally and systemically. Recent studies have indicated that genetic defects causing PIDs lead to perturbations in the conventional mechanisms underlying homeostasis in the gut, resulting in poor immune surveillance at the intestinal barrier, which associates with altered intestinal permeability and bacterial translocation. Consistently, a substantial proportion of PID patients presents with clinically challenging IBD-like pathology. Here, we describe the current body of literature reporting on dysbiosis of the gut microbiota in different PIDs and how this can be either the result or cause of immune dysregulation. Further, we report how infections in PIDs enhance pathobionts colonization and speculate how, in turn, pathobionts may be responsible for increased disease susceptibility and secondary infections in these patients. The potential relationship between the microbial composition in the intestine and other sites, such as the oral cavity and skin, is also highlighted. Finally, we provide evidence, in preclinical models of PIDs, for the efficacy of microbiota manipulation to ameliorate disease complications, and suggest that the potential use of dietary intervention to correct dysbiotic flora in PID patients may hold promise.