Lysosomes play a crucial role in regulating the growth, invasion and metastasis of different tumour types. However, the specific function of lysosomes in hepatocellular carcinoma (HCC) remains uncertain. We retrieved gene expression and clinical data from the TCGA and GEO databases for HCC samples and established a new lysosome‐associated prognostic therapeutic index (LAPTI) based on lysosome‐related genes through machine learning. We then systematically analysed clinical characteristics, functional enrichment, tumour immune microenvironment, molecular docking, chemotherapy response and immunotherapy response in HCC. LAPTI, composed of four lysosome‐related genes (CTSV, LAPTM4B, DNAJC6, AP1M2), is a reliable prognostic indicator for hepatocellular carcinoma patients and is validated in external data sets. Compared with the low LAPTI group, the high LAPTI group showed poorer prognosis and higher immune cell infiltration levels. We also observed that knocking down CTSV in vitro inhibited the proliferation and migration of hepatocellular carcinoma. This study provides valuable insights into the future clinical treatment of hepatocellular carcinoma by accurately assessing the prognosis of patients with hepatocellular carcinoma.