Hepatocellular carcinoma (HCC) is a classical inflammation-promoted cancer that occurs in a setting of liver diseases, including nonalcoholic fatty liver disease (NAFLD) or alcoholic liver disease (ALD). These pathologies share key characteristics, notably intestinal dysbiosis, increased intestinal permeability and an imbalance in bile acids, choline, fatty acids and ethanol metabolites. Translocation of microbial- and danger-associated molecular patterns (MAMPs and DAMPs) from the gut to the liver elicits profound chronic inflammation, leading to severe hepatic injury and eventually HCC progression. In this review, we first describe how the gut and the liver communicate and discuss mechanisms by which the intestinal microbiota elicit hepatic inflammation and HCC. We focus on the role of microbial products, e.g., MAMPs, host inflammatory effectors and host–microbiome-derived metabolites in tumor-promoting mechanisms, including cell death and senescence. Last, we explore the potential of harnessing the microbiota to treat liver diseases and HCC.