The present study aimed to investigate the therapeutic effects of berberine (BBR) on Salmonella enteritis in broiler chickens and to elucidate its mechanisms of action preliminarily. Blood samples were collected from 21- to 35-day-old Sanhuang male chicks to measure immune and biochemical indicators and to calculate the organ coefficients for the liver, spleen, bursa of Fabricius, and thymus. The caecal microbiota was analysed through 16S ribosomal RNA (rRNA) gene sequencing, and transcriptome sequencing was conducted. Compared with the positive control group (S), the berberine-treated group (BS) presented increased serum immunoglobulin M (IgM) levels, serum IgG levels, and total antioxidant capacity; berberine ameliorated the increase in the thymus index caused by Salmonella administration. The addition of berberine to the diet increased the abundance of beneficial bacterial genera, including Bacteroides and Lactobacillus. It also decreased the abundance of harmful bacterial genera, including Faecalibacterium and Streptococcus. Transcriptome analysis revealed that gene expression in the S and BS groups was associated with T cell selection and B cell receptor signalling pathways, which are enriched primarily in multiple immune-related signalling pathways, including the B cell receptor signalling pathway, NF-κ B signalling pathway, intestinal immune network for IgA production, asthma, and African trypanosomiasis. The significantly expressed genes included ATAD5, ERP29, MGST2, PIK3CA, and HSP90AA1. The present study demonstrated that berberine has a good therapeutic effect on Salmonella infection in chicks, as it inhibits the occurrence and development of Salmonella-induced intestinal inflammation by regulating the balance of the gut microbiota and the expression of related genes, including ATAD5, ERP29, MGST2, PIK3CA, and HSP90AA1.