Namibia, as many Sub-Saharan countries such faces increasing food insecurity due to a combination of climatic and socio-economic challenges. Despite having limited arable land, agriculture remains crucial for rural livelihoods in the country. Cowpea, a legume known for its resilience to water and temperature stress, plays an important role in the livelihoods of smallholder farmers in Namibia. This study aims to explore the potential of cowpea cultivation in Namibia and its impact on resource use. To investigate the resource demand of cowpea production, to assess the impact of irrigation and inoculation on cowpea productivity, and to analyze trade-offs between water and land resources in cowpea production, we integrate crop growth simulations with resource allocation optimization. Field experiment data inform our simulations of cowpea production, covering both rainfed and irrigated systems for standard and inoculated cowpeas. Our results show that both irrigation and inoculation substantially enhance cowpea productivity in northern Namibia, with yields reaching a maximum of 5.73 tons per hectare. In particular, inoculation emerges as a promising strategy for improving yields and resource efficiency without exacerbating water stress, unlike irrigation. Our simulations indicate that inoculated cowpea cultivation alone has the potential to meet the protein needs of the entire Namibian population using 10% of the current cropland and water resources. Therefore, inoculation is a viable strategy for smallholder farmers in Namibia to sustainably increase yields and reduce food insecurity under resource scarcity. In conclusion, this study highlights the importance of exploring innovative agricultural practices to address food insecurity in sub-Saharan countries such as Namibia and emphasizes the role of cowpea cultivation in achieving sustainable food production in the region.