Geobacillus sp. is recognized for its potential to produce bacteriocins, antibacterial substances that hold promise in addressing gastrointestinal illnesses. This study aimed to optimize the medium and pH conditions for producing antibacterial substances by Geobacillus kaustophilus Tm6T2 (a). The research employed a descriptive and experimental methodology. Growth studies were conducted in Mueller Hinton Broth with CaCl2 and MgSO4 and Nutrient Broth with KCl and MgCl2 across 6, 7, and 8 pH values. Subsequently, antibacterial substance production was achieved at the late logarithmic phase and was assessed against the gastrointestinal pathogen Salmonella typhimurium. Interestingly, findings indicated that antibacterial substance production might not solely correlate with bacterial cell count. Despite a lower bacterial cell count, the highest inhibition zone against S.typhimurium was observed at 13.11 mm in NB salt at pH 8. Analytical results show that the variation of pH and both mediums significantly affects the presence of the inhibition zone (p < 0.10). This finding suggests the complexity of factors influencing antibacterial activity. Overall, the optimum condition for antibacterial production in G.kaustophilus Tm6T2(a) was identified at pH 8 using NB salt. These findings have potential implications for developing antibacterial solutions targeting gastrointestinal pathogens.