I have stored smokeless and black powder and primers for many years (30 years plus) in an unheated metal building. It gets very cold (25 below zero) in the winter and very warm (100 degrees) in the summer. The primers are in original containers and about half are in steel ammo cans. The powder is in original containers.
Ideally, they should be stored at room temperature, they say, but I have a large quantity of both and store in the pole barn rather than the house to avoid a fire hazard in the home.
Everything, including H4831 powder from World War II that is older than I am, is in fine shape and works great in all of my firearms. I have never had a primer fail to pop or a can of powder spoil.
Keep it sealed and dry and store it where you have to.