Lymph node metastasis is one of the most important independent risk factors that can negatively affect the prognosis of prostate cancer (PCa); however, the exact mechanisms have not been well studied. This study aims to better understand the underlying mechanism of lymph node metastasis in PCa by bioinformatics analysis. We analysed a total of 367 PCa cases from the cancer genome atlas database and performed weighted gene co-expression network analysis to explore some modules related to lymph node metastasis. Gene Ontology analysis and pathway enrichment analysis were conducted for functional annotation, and a protein-protein interaction network was built. Samples from the International Cancer Genomics Consortium database were used as a validation set. The turquoise module showed the most relevance with lymph node metastasis. Functional annotation showed that biological processes and pathways were mainly related to activation of the processes of cell cycle and mitosis. Four hub genes were selected: CKAP2L, CDCA8, ERCC6L and ARPC1A. Further validation showed that the four hub genes well-distinguished tumour and normal tissues, and they were good biomarkers for lymph node metastasis of PCa. In conclusion, the identified hub genes facilitate our knowledge of the underlying molecular mechanism for lymph node metastasis of PCa.© 2020 The Authors. Journal of Cellular and Molecular Medicine published by Foundation for Cellular and Molecular Medicine and John Wiley & Sons Ltd.