We have designed, synthesized, and characterized a small library of shikonin derivatives and demonstrated their inhibitory activity against the main protease, Mpro, of SARS-CoV-2. One analog, 5,8-dimethyl shikonin oxime (15), exhibited the highest activity against SARS-CoV-2 Mpro with an IC50 value of 12.53 ± 3.59 μM. It exhibited much less toxicity as compared with the parent compound, shikonin, in both in vitro and in vivo models. Structure–activity relationship analysis indicated that the oxime moieties on the naphthalene ring and the functional groups attached to the oxygen atom on the side chain play a pivotal role in enzymatic inhibitory activity. Molecular docking results implied that the inhibitor 15 is perfectly settled in the core of the substrate-binding pocket of Mpro by possibly interacting with three catalytic residues, His41, Cys145, and Met165. Overall, the shikonin oxime derivative 15 deserves further investigation as an antiviral agent against SARS-CoV-2.