Epilepsy is a chronic disease that is characterized by transient brain dysfunction caused by an abrupt abnormal neuronal discharge. Recent studies have indicated that the pathways related to inflammation and innate immunity play significant roles in the pathogenesis of epilepsy, suggesting an interrelationship between immunity and inflammatory processes and epilepsy. However, the immune-related mechanisms are still not precisely understood; therefore, this study aimed to explore the immune-related mechanisms in epilepsy disorders, highlight the role of immune cells at the molecular level in epilepsy, and provide therapeutic targets for patients with epilepsy. Brain tissue samples from healthy and epileptic individuals were collected for transcriptome sequencing to identify differentially expressed genes (DEGs) and differentially expressed (DE)-long coding RNAs (lncRNAs). Based on interactions from the miRcode, starBase2.0, miRDB, miRTarBase, TargetScan, and ENCORI databases, a lncRNA-associated competitive endogenous RNA (ceRNA) network was created. Gene ontology and the Kyoto encyclopedia of genes analyses established that the genes in the ceRNA network were mainly enriched in immune-related pathways. Immune cell infiltration, screening, and protein-protein interaction analyses of the immune-related ceRNAs, and correlation analysis between immune-related core messenger RNA (mRNA) and immune cells were also performed. Nine hub genes (EGFR, GRB2, KRAS, FOS, ESR1, MAPK1, MAPK14, MAPK8, and PPARG) were obtained. Also, 38 lncRNAs, one miRNA (hsa-miR-27a-3p), and one mRNA (EGFR) comprised the final core ceRNA network. Mast cells, plasmacytoid dendritic cells, and immature dendritic cells all showed positive correlations with EGFR, while Cluster of differentiation 56 dim natural killer cells (CD56dim natural killer cells) showed negative correlations. Finally, we employed an epilepsy mouse model to validate EGFR, which is consistent with disease progression. In conclusion, the pathophysiology of epilepsy was correlated with EGFR. Thus, EGFR could be a novel biomarker of juvenile focal epilepsies, and our findings provide promising therapeutic targets for epilepsy.