The latest coronavirus pandemic (SARS-CoV-2) poses an exceptional threat to human health and society worldwide. The coronavirus (SARS-CoV-2) spike (S) protein, which is required for viral–host cell penetration, might be considered a promising and suitable target for treatment. In this study, we utilized the nonalkaloid fraction of the medicinal plant Rhazya stricta to computationally investigate its antiviral activity against SARS-CoV-2. Molecular docking and molecular dynamics simulations were the main tools used to examine the binding interactions of the compounds isolated by HPLC analysis. Ceftazidime was utilized as a reference control, which showed high potency against the SARS-CoV-2 receptor binding domain (RBD) in an in vitro study. The five compounds (CID:1, CID:2, CID:3, CID:4, and CID:5) exhibited remarkable binding affinities (CID:1, − 8.9; CID:2, − 8.7; and CID:3, 4, and 5, − 8.5 kcal/mol) compared to the control compound (− 6.2 kcal/mol). MD simulations over a period of 200 ns further corroborated that certain interactions occurred with the five compounds and the nonalkaloidal compounds retained their positions within the RBD active site. CID:2, CID:4, and CID:5 demonstrated high stability and less variance, while CID:1 and CID:3 were less stable than ceftazidime. The average number of hydrogen bonds formed per timeframe by CID:1, CID:2, CID:3, and CID:5 (0.914, 0.451, 1.566, and 1.755, respectively) were greater than that formed by ceftazidime (0.317). The total binding free energy calculations revealed that the five compounds interacted more strongly within RBD residues (CID:1 = − 68.8, CID:2 = − 71.6, CID:3 = − 74.9, CID:4 = − 75.4, CID:5 = − 60.9 kJ/mol) than ceftazidime (− 34.5 kJ/mol). The drug-like properties of the selected compounds were relatively similar to those of ceftazidime, and the toxicity predictions categorized these compounds into less toxic classes. Structural similarity and functional group analyses suggested that the presence of more H-acceptor atoms, electronegative atoms, acidic oxygen groups, and nitrogen atoms in amide or aromatic groups were common among the compounds with the lowest binding affinities. In conclusion, this in silico work predicts for the first time the potential of using five R. stricta nonalkaloid compounds as a treatment strategy to control SARS-CoV-2 viral entry.