Background Reprogramming of lipid metabolism is closely associated with tumor development, serving as a common and critical metabolic feature that emerges during tumor evolution. Meanwhile, immune cells in the tumor microenvironment also undergo aberrant lipid metabolism, and altered lipid metabolism also has an impact on the function and status of immune cells, further promoting malignant biological behavior. Consequently, we focused on lipid metabolism-related genes for constructing a novel prognostic marker and evaluating immune status in prostate cancer. Methods Information about prostate cancer patients was obtained from TCGA and GEO databases. The NMF algorithm was conducted to identify the molecular subtypes. The least absolute shrinkage and selection operator (Lasso) regression analysis was applied to establish a prognostic risk signature. CIBERSORT algorithm was used to calculate immune cell infiltration levels in prostate cancer. External clinical validation data were used to validate the results. Results Prostate cancer samples were divided into two subtypes according to the NMF algorithm. A six-gene risk signature (PTGS2, SGPP2, ALB, PLA2G2A, SRD5A2, and SLC2A4) was independent of prognosis and showed good stability. There were significant differences between risk groups of patients with respect to the infiltration of immune cells and clinical variables. Response to immunotherapy also differed between different risk groups. Furthermore, the mRNA expression levels of the signature genes were verified in tissue samples by qRT-PCR. Conclusion We constructed a six-gene signature with lipid metabolism in prostate cancer to effectively predict prognosis and reflect immune microenvironment status.