Prostate cancer is the most common tumor in men worldwide with a poor prognosis. In recent years, studies have revealed that pyroptosis can affect the tumor immune microenvironment. However, the relationship between the immune microenvironment regulated by pyroptosis-related genes and the prognosis of prostate cancer is still unclear. Thirty-three cell death-associated genes were selected from a literature review. The "DESeq2" R package was used to identify differentially expressed cell death-associated genes between normal prostate tissue (GTEx) and prostate cancer tissue (TCGA) samples. Biological functional enrichment analysis of differentially expressed cell death genes was performed using R statistical software packages, such as "clusterProfiler," "org.Hs.eg.db," "enrichplot," "ggplot2," and "GOplot." Univariate Cox and LASSO Cox regression analyses were conducted to identify prognostic genes associated with the immune microenvironment using the "survival" package. Finally, a predictive model was established based on Gleason score, T stage, and cell death-associated genes.odel was established based on Gleason score, T stage, and cell death-associated genes. Seventeen differentially expressed genes related to pyroptosis were screened out. Based on these differentially expressed genes, biological function enrichment analysis showed that they were related to pyroptosis of prostate cells. Based on univariate Cox and (LASSO) Cox regression analysis, four pyroptosis-related genes (CASP3, PLCG1, GSDMB, GPX4) were determined to be related to the prognosis of prostate cancer, and the immune correlation analysis of the four pyroptosis-related genes was performed. The expression of CASP3, PLCG1 and GSDMB was positively correlated with the proportion of immune cells, and the expression of GPX4 was negatively correlated with the proportion of immune cells. A predictive nomogram was established by combining Gleason score, T and pyroptosis genes. The nomogram was accompanied by a calibration curve and used to predict 1 -, 2 -, and 5-year survival in PAAD patients. Cell death-associated genes (CASP3, PLCG1, GSDMB, GPX4) play crucial roles in modulating the immune microenvironment and can be used to predict the prognosis of prostate cancer.