Most human cancers develop from stem and progenitor cell populations through the sequential accumulation of various genetic and epigenetic alterations. Cancer stem cells have been identified from medulloblastoma (MB), but a comprehensive understanding of MB stemness, including the interactions between the tumor immune microenvironment and MB stemness, is lacking. Here, we employed a trained stemness index model based on an existent one‐class logistic regression (OCLR) machine‐learning method to score MB samples; we then obtained two stemness indices, a gene expression‐based stemness index (mRNAsi) and a DNA methylation‐based stemness index (mDNAsi), to perform an integrated analysis of MB stemness in a cohort of primary cancer samples (n = 763). We observed an inverse trend between mRNAsi and mDNAsi for MB subgroup and metastatic status. By applying the univariable Cox regression analysis, we found that mRNAsi significantly correlated with overall survival (OS) for all MB patients, whereas mDNAsi had no significant association with OS for all MB patients. In addition, by combining the Lasso‐penalized Cox regression machine‐learning approach with univariate and multivariate Cox regression analyses, we identified a stemness‐related gene expression signature that accurately predicted survival in patients with Sonic hedgehog (SHH) MB. Furthermore, positive correlations between mRNAsi and prognostic copy number aberrations in SHH MB, including MYCN amplifications and GLI2 amplifications, were detected. Analyses of the immune microenvironment revealed unanticipated correlations of MB stemness with infiltrating immune cells. Lastly, using the Connectivity Map, we identified potential drugs targeting the MB stemness signature. Our findings based on stemness indices might advance the development of objective diagnostic tools for quantitating MB stemness and lead to novel biomarkers that predict the survival of patients with MB or the efficacy of strategies targeting MB stem cells.