Vitamin B
12
(VB
12
) is an indispensable cofactor of metabolic enzymes and has been widely used in the food and pharmaceutical industries. In this study, the effects of medium composition on VB
12
production by
Propionibacterium freudenreichii
were evaluated and optimized based on statistical experiments. The results showed that glucose, yeast extract, KH
2
PO
4
, and glycine have significant effects on VB
12
production. The final titer of VB
12
reached 8.32 ± 0.02 mg/L, representing a 120% increase over the non‐optimized culture medium. We employed a metabolomics approach to analyze the differences of metabolite concentrations in
P
.
freudenreichii
cells cultivated in the original medium and optimized fermentation medium. Using multivariate data analysis, we identified a range of correlated metabolites, illustrating how metabolomics can be used to explain VB
12
production changes by corresponding differences in the overall cellular metabolism. The concentrations of many metabolic intermediates of glycolysis, the Wood–Werkman cycle, the TCA cycle, and amino acid metabolism were increased, which contributed to the synthesis of propionic acid and VB
12
due to an improved supply of energy and precursors.