Ammonia is one of the most important compounds in the chemical industry as it is the main raw material in the production of fertilizers. Its production is achieved using the Haber-Bosch process, where nitrogen and hydrogen react in the presence of a catalyst producing a mixture containing ammonia. In this work we use molecular simulations to study the effect of confinement on the ammonia synthesis reaction in pure silica zeolites FER, MOR, MFI, BEA, LTA, and FAU. We calculated adsorption isotherms and isobars of the components resulting from the reaction for a wide range of values of pressure and temperature. The removal of the resulting ammonia will keep the equilibrium of the reaction favoring ammonia formation at lower values of pressure than in conventional plants. Among the studied zeolites, FAU and ITQ-29 are preferred for ammonia storage because of their higher adsorption capacity. The effect of confinement is proven to increase ammonia production, being the zeolites with the narrowest pores (FER and MFI) the ones that exhibit the highest conversion of the reactants. Besides, we found that the optimal working conditions for the production process in confinement are 573 K and 200 bar. At these particular conditions, the production of ammonia increases without the addition of any extra operational costs to the process.