Ammonia, with its exceptional storage and transportation characteristics, emerges as a promising hydrogen carrier that can play a crucial role in this transition. This study investigates the techno-economic and environmental feasibility of utilizing produced water (PW), a waste product in oil and gas production, for ammonia production (AP). Accordingly, three distinct scenarios of utilizing the PW to produce ammonia are analyzed: i) fossil fuel-based (FF) AP without CO2 capture (gray), ii) FF-based AP with CO2 capture module (blue), and iii) a solar-thermal based AP (green). Results suggest that the blue system offers a compromise between environmental impact and economic feasibility, achieving a significant reduction in CO2 emissions of 0.605 kg CO2/kg NH3 compared with the 1.87 kg CO2/kg NH3, where gray, blue, and green AP are associated with the values of $435.63/tNH3, $480.41/tNH3, and $955.05/tNH3, respectively. Moreover, this study highlights the influence of carbon tax policy on the cost of the FF-based gray systems, while becoming unprofitable above $104.75/tCO2. Analysis of AP costs across shale formations reveals variations in product cost with salt concentrations, with the Bakken and Haynesville formations exhibiting the highest cost per ton of ammonia of $433 and $426/tNH3 for blue and gray systems, respectively. Notably, it is observed that the formations with high solar radiation and low salinity including Permian and Niobrara show potential for green ammonia with payback periods of 13 and 15 years, respectively. This can be used as reliable benchmark to propose a model for achieving sustainable society.