Primary liver cancer is one of the leading causes of cancer death worldwide. Surgical and non-surgical treatments are optional for liver cancer therapy based on the cancer stage. Accumulating studies show that the gut–liver axis influences the progression of liver diseases, including liver inflammation, fibrosis, cirrhosis, and cancer. However, the role of gut microbiota and their derived components and metabolites in liver cancer remains to be further clarified. In this review, we discuss the roles of gut microbiota and specific bacterial species in HCC and the strategies to modulate gut microbiota to improve antitumor therapy. Given the limitation of current treatments, gut microbiota-mediated therapy is a potential option for HCC treatment, including fiber diet and vegetable diet, antimicrobials, probiotics, and pharmaceutical inhibitors. Also, gut microbiota can be used as a marker for early diagnosis of HCC. HCC occurs dependent on various environmental and genetic factors, including diet and sex. Furthermore, gut microbiota impacts the immunotherapy of HCC treatment. Therefore, a better understanding of the role of the gut–liver axis in liver cancer is critically important to improve therapeutic efficacy.