Basil (Ocimum basilicum L.) comprises green and purple cultivars, worldwide cultivated and appreciated for high contents of rosmarinic acid and anthocyanins, respectively. Although nitrogen (N) fertilization is needed for high yields, in basil it could have detrimental effects on the accumulation of phenolic compounds. In this study, plants of the cultivars ‘Italiano Classico’ (green) and ‘Red Rubin’ (purple) were grown in hydroponics and subjected to different nutritional treatments, consisting in N starvation, and nitrate (NO3−) or ammonium (NH4+) nutrition. Plant growth and nutritional status, estimated by the contents of NO3−, NH4+, and amino acids in roots and leaves, were evaluated and put in relation with quality traits of basil leaves, such as chlorophyll content, antioxidant capacity, total phenols, the activity of phenylalanine ammonia-lyase, and the concentrations of individual (poly)phenolic acids and flavonoids. This study reveals that N starvation, as well as the availability of the two inorganic N forms, differently affect the phenolic composition in the two cultivars. Compared to plants grown in NO3− availability, in NH4+ availability, green basil showed a higher content of (poly)phenolic acids, while in purple basil, an increase in the contents of anthocyanins was detected. Overall, the study suggests that the management of NH4+ supply could contribute to enhance crop quality in hydroponics, and provides new knowledge about the relationship between N nutrition and phenolic metabolism in basil.