Nile tilapia (Oreochromis niloticus) is one of the most important commercial freshwater fish in China, and dietary transition occurs in their different life stages. The gut microbiota is important to host health. The relationships among the diet, gut microbiota, and development of tilapia are not well known. In the present study, we attempted to understand how diet is associated with microbiota community dynamics during the development of tilapia. The first experiment was performed under standard laboratory feeding operation to determine the effect of diet transition on intestinal microbiota. In the second experiment, tilapia were fed with Artemia or plant-based dry (PBD) food from the fish started feeding to their late juvenile stage (90 days post-fertilization). The results in the first experiment showed that feeding habit transition in juvenile fish had a low effect on the microbiota of the tilapia intestine. In the second experiment, plant-based food negatively affected the survival rate and intestinal development of tilapia. The phylum Planctomycetes was dominant in juvenile fish fed PBD food. The phylum Fusobacteria was dominant in the juvenile fish fed Artemia. At the genus level, Gemmobacter, Pirellula, and Planctomyces, belonging to the phylum Planctomycetes, were significantly abundant in the guts of fish fed the PBD food diet. Cetobacterium of the phylum Fusobacteria was dominant in juvenile fish fed Artemia. Thus, we can conclude that diet types have a great effect on the microbiota of tilapia intestine in their early life stages. The intestinal microflora of tilapia was established in juvenile tilapia, approximately 2 months after hatching. Our results provide useful information for the experimental design of studies on the microbial community of the tilapia gut. We suggest that modulation of gut microbiota of tilapia could be performed in their early life.