Background: Surgery is a potential curative treatment for hepatocellular carcinoma (HCC), but postoperative recurrence occurs in majority of patients. Currently, there are no robust biomarkers to predict the disease progression or recurrence. Methods: Weighted gene correlation network analysis (WGCNA) was used to construct co-expression network. The least absolute shrinkage and selection operator (LASSO) method was applied to develop prognostic model. Survival analysis, gene set variation analysis (GSVA) and gene set enrichment analysis (GSEA) were performed to assess the performance. Results: By using GSE14520 dataset, 16 hub genes associated with HCC metastasis were screened. A signature of 5 metastasis-related genes was subsequently constructed by incorporating TCGA LIHC dataset. HCC patients with high risk score have low survival rate, low disease free survival rate and high recurrence rate. The prognostic value of this 5-mRNA signature was further verified in pan-cancer datasets. A nomogram was built with excellent performance and potential clinical application for prognosis. GSVA and GSVA revealed that metabolic pathways are distinct between high- and low-risk groups. Conclusions: We have established a 5-mRNA signature and a nomogram that can efficiently predict metastasis, recurrence and patient survival in HCC.