Staphylococcus aureus is an important pathogenic bacterium responsible for various organ infections. The serious side effects and the development of antibiotic resistance have rendered the antibiotic therapy against S. aureus increasingly challenging, emphasizing the pressing need for the exploration of novel therapeutic agents. Our research has uncovered the promising antimicrobial properties of 8-octyl berberine (OBBR), a novel compound derived from berberine (BBR), against S. aureus. OBBR exhibited a minimum inhibitory concentration (MIC) of 1.0 μg/mL, which closely approximated that of levofloxacin. Intriguingly, a multipassage resistance assay demonstrated that the MIC of OBBR against S. aureus remained relatively stable, while levofloxacin exhibited a 4-fold increase over 20 days, suggesting that OBBR was less prone to inducing resistance. Mechanistically, our investigation, employing Zeta potential measurements, flow cytometry, scanning electron microscopy, and transmission electron microscopy, unveiled that OBBR induced morphological alterations in the bacteria. Furthermore, it disrupted the bacterial cell wall and membrane by altering membrane potential and compromising membrane integrity. These actions culminated in bacterial disintegration and apoptosis. Transcriptomic analysis shed light on significant downregulation of gene ontology terms, predominantly associated with membranes. The Kyoto Encyclopedia of Genes and Genomes pathway enrichment analysis implicated OBBR in disturbing peptidoglycan biosynthesis, with the membrane protein MraY emerging as a potential target for OBBR's action against S. aureus. Notably, experiments involving the overexpression of MraY confirmed OBBR's inhibitory effect on peptidoglycan synthesis. Furthermore, molecular docking and cellular thermal shift assay revealed OBBR's direct interaction with MraY, potentially leading to the inhibition of the enzymatic activity of MraY and, consequently, impeding peptidoglycan synthesis. In summary, OBBR, by targeting MraY and inhibiting peptidoglycan synthesis, emerges as a promising alternative antibiotic against S. aureus, offering potential advantages in terms of limited drug resistance development.