Urban farming on rooftops is a contemporary approach that combines the benefits of green roofing with food production within the city sprawl. The present study aims at assessing plant growth, nutritional value, and consumer safety of two vegetables, lettuce (Lactuca sativa L.) and tomato (Solanum lycopersicum L.) grown on urban green roof. Treatments included: (a) two substrate depths (7.5 and 15 cm) and (b) three types of fertilization (granulated complex fertilizer [GF], slow nitrogen release complex fertilizer [SR], and liquid fertigation [LF]). Measurements included plant growth, total fresh yield, dry weight, and quality characteristics such as nutrient content, nitrate accumulation in lettuce and firmness, and total soluble solids [TSS] in tomatoes. Production safety was evaluated through tissue analyses of the edible parts for heavy metal residues. Results showed that 15 cm substrate depth improved the total yield for both vegetables, and the firmness of tomato fruit, compared to 7.5 cm depth. Fertilization type had no impact on tomato productivity but GF increased TSS in tomato fruits while LF enhanced lettuce yield. The deeper substrate increased N, P, K, Ca, Mg in lettuce leaves but only P and Mn in tomato fruits. In contrast, fertilization type affected leaf nutrient levels in lettuce, where N, P, and Mg were increased using LF. In tomato, the LF increased the fruit P, K, Ca, Mg, and Fe concentration. LF increased the concentration of nitrates in lettuce to levels exceeding the maximum safety limits according to the European Food Safety Authority (EFSA) but not according to EU regulation No 1258/2011. The leaf Mn concentrations in lettuce were higher than the health limits for young children in all measured samples irrespective of the experimental treatments. Selenium (Se) exceeded the health limits in tomato fruits for adults and toddlers using SR but only for toddlers using LF, while GF maintained the Se content below the safety levels. Lead (Pb) and aluminium (Al) were high for both vegetables but did not exceed the EFSA safety limits for adults. However, Pb exceeded the EU Commission Regulation No 420/2011 limit, for both vegetables and fertilization treatments. Washing the leaves of lettuce reduced only Fe and Al concentration but the remaining elements were unaffected. In conclusion, our results suggest that lettuce and tomato of adequately high quality for human consumption can be produced on urban green roofs with shallow substrate depths ranging from 7.5 to 15 cm but, further research is needed to ensure production safety.