Withania somnifera is an important medicinal plant that contains withanolides and withaferins, both bioactive compounds. We have tested the effects of macroelements and nitrogen source in W. somnifera cell suspension cultures with the aim of optimizing the production of biomass and withanolide A. The effects of the macroelements NH4NO3, KNO3, CaCl2, MgSO4 and KH2PO4 at concentrations of 0.0, 0.5, 1.0, 1.5 and 2.0× strength and of the nitrogen source [NH4+/NO3− (mM/mM) ratio of: 0.00/18.80, 7.19/18.80, 14.38/18.80, 21.57/18.80, 28.75/18.80, 14.38/0.00, 14.38/9.40, 14.38/18.80, 14.38/28.20, and 14.38/37.60 (mM)] in Murashige and Skoog medium were tested for biomass and withanolide A production. The highest accumulation of biomass [147.81 g l−1 fresh weight (FW) and 14.02 g l−1 (dry weight (DW)] was recorded in the medium containing a 0.5× concentration of NH4NO3, and the highest production of withanolide A content was recorded in the medium with 2.0× KNO3 (4.36 mg g−1 DW). The NH4+/NO3− ratio also influenced cell growth and withanolide A production, with both parameters being larger when the NO3− concentration was higher than that of NH4+. Maximum biomass growth (110.45 g l−1 FW and 9.29 g l−1 DW) was achieved at an NH4+/NO3− ratio of 7.19/18.80, while withanolide A production was greatest (3.96 mg g−1 DW) when the NH4+/NO3− ratio was 14.38/37.60 mM.