Nonalcoholic steatohepatitis (NASH) is a highly prevalent metabolic disorder. Currently, there are no effective pharmacotherapeutic options for preventing and treating NASH. Portulaca oleracea L. (POL) is an edible herb that has been used for preventing and treating some metabolic disorders in China, but the bioactive constituents in POL and the related mechanisms for treating NASH are still unclear. Here, a comprehensive research strategy was used to identify the core genes and the key constituents in POL for treating NASH, via integrating bioinformatics analysis and experimental pharmacology both in vitro and in vivo. The phenotypes and mechanisms of POL were carefully investigated by performing a set of in vivo and in vitro experiments. Bioinformatics analysis suggested that prostaglandin-endoperoxide synthase 2 (PTGS2) was the core target and myricetin (Myr) was the key constituent in POL for treating NASH. In NASH mice model induced by methionine choline deficiency diet, POL significantly alleviated hepatic steatosis and liver injury. In free fatty acids-induced hepatocytes, POL and Myr significantly down-regulated the expression of PTGS2, decreased the number of lipid droplets, and regulated the mRNA expression of lipid synthesis and homeostasis genes, including FASN, CPT1a, SERBP1c, ACC1, and SCD1. In lipopolysaccharide-induced macrophages, POL and Myr significantly reduced the expression of PTGS2 and blocked the secretion of inflammatory mediators TNF-α, IL-6, and IL-1β. Further investigations demonstrate that Myr acts as both suppressor and inhibitor of PTGS2. Collectively, POL and its major component Myr can ameliorate NASH via down-regulating and inhibiting PTGS2, suggesting that POL and Myr can be developed as novel medicines for treating NASH.