Nonalcoholic fatty liver disease (NAFLD) is among the most prevalent chronic liver diseases around the globe. The accumulation of lipids in the liver and oxidative stress are important pathological mechanisms of NAFLD. Astaxanthin (AT) is a carotenoid extracted from shrimps and crabs with beneficial biological activities, including anti-oxidative and anti-inflammatory activities. 16S microflora sequencing, H&E staining, and the western blot technique were employed to investigate the impacts of AT on a high-fat diet (HFD)-induced NAFLD. Significant mitigation in lipid metabolism-related disorders and decreased oxidative stress in HFD-induced mice were observed due to AT, and significant changes in the gut flora of the model mice were also observed. The in vitro study showed that AT considerably lowered the protein expression level of fatty acid synthetase (FAS), sterol regulatory element-binding protein-1c (SREBP-1c), and acetyl-COA carboxylase (ACC) and increased the protein expression of nuclear factor-E2 associated factor 2 (Nrf2) and AMP-activated protein kinase (AMPK) in oleic acid (OA) and palmitic acid (PA)-induced HepG2 cells. Additionally, mechanistic studies revealed that compound C (AMPK inhibitor, CC) inhibited the regulatory effect of AT on the SREBP-1c and Nrf2 signaling pathways. In conclusion, AT can inhibit the SREBP-1c, FAS, and ACC signaling pathways, activate the AMPK and Nrf2 signaling pathways, and improve the structure of intestinal flora.