Gastric cancer (GC) is a prevalent cancer, which remains incurable, and therefore requires an alternative treatment method. Celecoxib is a nonsteroidal anti-inflammatory drug that targets cyclooxygenase-2, and exhibits anticancer effects. The present study aimed to investigate the anti-GC mechanism of celecoxib using bioinformatics methods. Gene expression datasets GSE56807 (GC tissues and normal gastric tissues) and GSE54657 (celecoxib-treated and non-treated human GC epithelial AGS cells) were downloaded from the Gene Expression Omnibus database. Two groups of differentially expressed genes (DEGs) were identified using limma package in R language. The criterion for GSE56807 was a false discovery rate of <0.05, while that for GSE54657 was P<0.01. Overlapping DEGs from the two datasets were screened out. Subsequently, pathway enrichment analysis was performed using Database for Annotation, Visualization and Integrated Discovery software (P<0.1; gene count ≥2). In addition, the protein-protein interactions (PPIs) among the overlapped DEGs were obtained based on IntAct, Database of Interacting Proteins, Biomolecular Interaction Network Database and Human Protein Reference Database. Finally, a PPI network was visualized using Cytoscape software. A total of 137 overlapped DEGs were obtained, and DEGs with opposite regulation directions in the two datasets were significantly enriched in focal adhesion and leukocyte transendothelial migration. Subsequently, a PPI network of overlapped DEGs was constructed. Comprehensively, a total of 8 key DEGs [cysteine and glycine rich protein 1 (CSRP1), thrombospondin 1 (THBS1), myosin light chain 9 (MYL9), filamin A (FLNA), actinin alpha 1 (ACTN1), vinculin (VCL), laminin subunit gamma 2 (LAMC2) and claudin 1 (CLDN1)] were upregulated in GC tissues and downregulated in celecoxib-treated cells. In conclusion, celecoxib may exhibit anti-GC effects by suppressing the expression of CSRP1, THBS1, MYL9, FLNA, ACTN1, VCL, LAMC2 and CLDN1, and inhibiting leukocyte transendothelial migration and focal adhesion. However, relevant experiments are required to confirm the conclusion of the present study.