A growing body of data suggests that the microbiome of a species can vary considerably from individual to individual, but the reasons for this variation - and the consequences for the ecology of these communities – remain only partially explained. In mammals, the emerging picture is that the metabolic state and immune system status of the host affects the composition of the microbiome, but quantitative ecological microbiome studies are challenging to perform in higher organisms. Here we show that these phenomena can be quantitatively analyzed in the tractable nematode host Caenorhabditis elegans. Mutants in innate immunity, in particular the DAF-2/Insulin Growth Factor (IGF) pathway, are shown to contain a microbiome that differs from that of wild type nematodes. We analyze the underlying basis of these differences from the perspective of community ecology by comparing experimental observations to the predictions of a neutral sampling model and conclude that fundamental differences in microbiome ecology underlie the observed differences in microbiome composition. We test this hypothesis by introducing a minor perturbation to the colonization conditions, allowing us to assess stability of communities in different host strains. Our results show that altering host immunity changes the importance of inter-species interactions within the microbiome, resulting in differences in community composition and stability that emerge from these differences in host-microbe ecology.ImportanceHere we use a Caenorhabditis elegans microbiome model to demonstrate how genetic differences in innate immunity alter microbiome composition, diversity, and stability by changing the ecological processes that shape these communities. These results provide insight into the role of host genetics in controlling the ecology of host-associated microbiota, resulting in differences in community composition, successional trajectories, and response to perturbation.