Intensive shrimp farming may lead to adverse environmental consequences due to discharged water effluent. Inoculation of microalgae can moderate the adverse effect of shrimp-farming water. However, how bacterial communities with different lifestyles (free-living (FL) and particle-attached (PA)) respond to microalgal inoculation is unclear. In the present study, we investigated the effects of two microalgae (Nannochloropsis oculata and Thalassiosira weissflogii) alone or in combination in regulating microbial communities in shrimp-farmed water and their potential applications. PERMANOVA revealed significant differences among treatments in terms of time and lifestyle. Community diversity analysis showed that PA bacteria responded more sensitively to different microalgal treatments than FL bacteria. Redundancy analysis (RDA) indicated that the bacterial community was majorly influenced by environmental factors, compared to microalgal direct influence. Moreover, the neutral model analysis and the average variation degree (AVD) index indicated that the addition of microalgae affected the bacterial community structure and stability during the stochastic process, and the PA bacterial community was the most stable with the addition of T. weissflogii. Therefore, the present study revealed the effects of microalgae and nutrient salts on bacterial communities in shrimp aquaculture water by adding microalgae to control the process of community change. This study is important for understanding the microbial community assembly and interpreting complex interactions among zoo-, phyto-, and bacterioplankton in shrimp aquaculture ecosystems. Additionally, these findings may contribute to the sustainable development of shrimp aquaculture and ecosystem conservation.