The leafminer Tuta absoluta Meyrick (Lepidoptera: Gelechiidae) is one of the most important pests of tomato, reducing crop yields by up to 100% in greenhouses and fields, in several countries globally. Because synthetic insecticides lead to resistance and have adverse effects on natural enemies and the health of producers, alternative control methods are needed. In this study, we assessed the oviposition-deterring effect of basil plants, Ocimum gratissimum L. and O. basilicum L. (Lamiaceae), using dual-choice behavioural assays performed in flight tunnels. We found that both plants significantly reduced T. absoluta oviposition behaviour on a tomato plant located nearby. To evaluate the potential effect of basil volatile organic compounds, we formulated essential oils of both plant species in paraffin oil, and observed a similar oviposition-deterring effect. Gas chromatography analyses detected 18 constituents in these essential oils which the major constituents included thymol (33.3%), p-cymene (20.4%), γ-terpinene (16.9%), myrcene (3.9%) in O. gratissimum and estragol (73.8%), linalool (8.6%), β-elemene (2.9%) and E-β-ocimene (2.6%) in O. basilicum. Twenty and 33 compounds were identified of the volatiles collected on O. gratissimum and O. basilicum plants, respectively. The main components include the following: p-cymene (33.5%), γ-terpinene (23.6%), α-terpinene (7.2%), α-thujene (6.7%) and E-α-bergamotene (38.9%) in O. gratissimum, and methyl eugenol (26.1%), E-β-ocimene (17.7%), and linalool (9.4%) in O. basilicum. Four compounds (α-pinene, β-pinene, Myrcene, Limonene) were common in essential oils and plants. Our results suggest the valuable potential of basil and associated essential oils as a component of integrated management strategies against the tomato leafminer.