The scarcity of fresh water resources has severely limited agricultural production in arid areas. Although brackish water irrigation or fresh water deficit irrigation can alleviate the water resources crisis, both may cause water and salt stress to crop. Therefore, this study is based on the functional advantages of Bacillus subtilis in soil improvement and crop growth promotion to alleviate water and salt stress and build safe and efficient water-saving irrigation patterns. In this study, cotton (No. 50 Chuangmian) was selected as the research crop, and five application rates of Bacillus subtilis (0, 22.5, 45, 67.5 and 90 kg·ha−1) were combined with three irrigation patterns (brackish water, fresh water and fresh water deficit irrigations) to study the effects of Bacillus subtilis on soil moisture and salinity, soil microbial community, cotton physiology and growth under water and salt stress. The results showed that Bacillus subtilis could enhance soil water retention capacity, promote soil desalination, improve cotton growth indices (plant height, stem diameter, leaf area index, dry matter accumulation), and then increase yield and water use efficiency (WUE). Compared with the control treatment, the yield and WUE of Bacillus subtilis application treatments increased by 3.32–54.67 % and 1.68–41.07 %, respectively. In the cotton physiology characteristics, Bacillus subtilis increased proline content and the activity of superoxide dismutase, peroxidase and catalase while decreased malondialdehyde content in cotton leaves. Bacillus subtilis could enhance the relative abundance of bacteria with the functions of nitrogen fixation, stress resistance and biocontrol. A structural equation model proved that Bacillus subtilis could improve yield and WUE indirectly by directly improving soil microbial diversity, alleviating water and salt stress, and then improving cotton physiology and growth. According to a comprehensive evaluation of cotton physiology and growth, it was determined that the optimal improvement effect was achieved when the application rate of Bacillus subtilis was 45 kg ha−1; the synergistic effect of brackish water irrigation and Bacillus subtilis (45 kg·ha−1) was superior to that of fresh water deficit irrigation combining with Bacillus subtilis (45 kg·ha−1), which could be considered a priority strategy for alleviating the fresh water crisis in arid areas and promoting the efficient increase in cotton yield.