Background: Cutaneous melanoma is cancer that is both malignant and aggressive, with a poor prognosis. Pyroptosis can affect the prognosis of cancer patients by controlling tumor cell growth, migration, and metastasis, as well as is closely related to the tumor immune microenvironment. The significance of pyroptosis-related genes (PRGs) in cutaneous melanoma, however, is unknown. Methods: The training set and external validation sets were cutaneous melanoma samples from The Cancer Genome Atlas (TCGA) database and Gene Expression Omnibus (GEO), respectively. By using univariate Cox regression analysis and selection operator (Lasso) regression model, prognostic genes for overall survival (OS) were found. Candidate genes that were screened were used to calculate risk scores and construct a PRG risk model. The Kaplan Meier curve, time-dependent receiver operating characteristic (ROC) curve, and area under the curve (AUC)were used to assess the functional and prognostic usefulness of gene signatures in the risk model. Furthermore, to speculate on the activity of immune cell infiltration and immune-related pathways in the tumor immune microenvironment and calculate corresponding scores, a single sample gene set enrichment analysis (ssGSEA) was used.Results: An eight PRGs risk signature (AIM2, CASP4, CASP5, CASP8, IL18, NLRC4, NLRP6, PRKACA) were conducted and divided all cutaneous melanoma patients in the TCGA cohort into two groups: Low-risk and High-risk. Both the training and external validation sets showed that patients in the low-risk group showed a significantly higher likelihood of survival than those in the high-risk group (p < 0.001). Except for PRKACA, all the other eight PRGs in our study appeared to be longer survival times for patients. The results of ssGSEA in terms of 16 types of immune cells and the activity of 13 immune-related pathways showed that the High-risk group had lower immune pathway activity and lower levels of immune cell infiltration. In conclusion, the PRG-signature may be a significant predictor of prognosis and may play an essential role in UM patients' tumor immunity.