The influence of microbes on myriad animal traits and behaviors has been increasingly recognized in recent years. The fruit fly Drosophila melanogaster is a model for understanding microbial interactions with animal hosts, facilitated by approaches to rear large sample sizes of Drosophila under microorganism-free (axenic) conditions, or with defined microbial communities (gnotobiotic). This work outlines a method for collection of Drosophila embryos, hypochlorite dechorionation and sterilization, and transfer to sterile diet. Sterilized embryos are transferred to sterile diet in 50 ml centrifuge tubes, and developing larvae and adults remain free of any exogenous microbes until the vials are opened. Alternatively, flies with a defined microbiota can be reared by inoculating sterile diet and embryos with microbial species of interest. We describe the introduction of 4 bacterial species to establish a representative gnotobiotic microbiota in Drosophila. Finally, we describe approaches for confirming bacterial community composition, including testing if axenic Drosophila remain bacteria-free into adulthood.