The microbial communities interact with the host immunity and physiological functions. In this study, we investigated the bacterial composition in the shrimp Litopenaeus vannamei gut and rearing water under different host (developmental stage: juvenile and adult health status: healthy and diseased) and environmental factors (temperature: 25oC and 28oC light intensity: low and high). The PCoA analysis showed that all water samples were clustered together in a quarter, whereas the gut samples spread among three quarters. In term of functional bacteria, gut samples of adult shrimp, healthy adult shrimp, adult shrimp raised at 28oC, and juvenile shrimp under high light intensity, has been found higher abundance of Vibrionaceae compared to each opposite group. Gut samples of juvenile shrimp, infected adult shrimp, juvenile shrimp with low light intensity, and adult shrimp with a water temperature of 25oC groups, showed the higher abundance of Pseudoaltromonadaceae bacteria compared to each opposite group. Gut samples of juvenile shrimp, healthy adult shrimp, adult shrimp with water temperature of 28oC, and juvenile shrimp with high light intensity groups showed the higher abundance of Firmicutes/Bacteroidota ratio compared to each opposite group. Our results showed that L. vannamei juveniles are more sensitive for the bacterial infection, and both water temperature of 28oC and high light intensity were important conditions improving the shrimp gut bacterial composition under industrial indoor farming systems