From the standpoint of the ER (endoplasmic reticulum), we were interested in identifying hub genes that impact clinical prognosis for HCC (hepatocellular carcinoma) patients and developing an ER-related prognostic model. Using TCGA-LIHC (The Cancer Genome Atlas-Liver Hepatocellular Carcinoma) and GSE14520 datasets, we conducted a series of analyses, which included differential gene screening, clinical prognostic analysis, Lasso regression, nomogram prediction, tumour clustering, gene functional enrichment, and tumour infiltration of immune cells. Following our screening for ER-related genes (
n
=
1975
), we conducted a Lasso regression model to obtain five hub genes, KPNA2, FMO3, SPP1, KIF2C, and LPCAT1, using TCGA-LIHC as a training set. According to risk scores, HCC samples within either the TCGG-LIHC or GSE14520 cohort were categorized into high- and low-risk groups. Compared to the high-risk group of HCC patients, patients in the low-risk group had a better prognosis of OS (overall survival) or RFS (relapse-free survival). For TCGA-LIHC training set, with the factors of risk score, stage, age, and sex, we plotted a nomogram for 1-, 3-, and 5-year survival predictions. Our model demonstrated better clinical validity in both TCGA-LIHC and GSE14520 cohorts. Additionally, events related to biological enzyme activity, biological metabolic processes, or the cell cycle were associated with the prognostic risk of ER. Furthermore, two HCC prognosis-associated tumour clusters were identified by ER hub gene-based consensus clustering. Our findings indicated a link between ER prognostic signature-related high/low risk and tumour infiltration levels of several immune cells, such as “macrophages M2/M0” and “regulatory T cells (Tregs).” Overall, we developed a novel ER-related clinical prognostic model for HCC patients.