My short answer: "yes." Now for the "how to"!
In the above photo, you'll see I've got flour stored in Mylar bags, and then I put them in the large plastic lidded bins.
Even though the flour, rice, and beans are "dry" to begin with, if you're interested in storing these items safely, for long-term storage, then follow the vacuuming-sealing method used when storing your dehydrated foods. I still highly advise adding in an oxygen absorber into the individual vacuum-sealer bags as they keep mold-growth at bay. You'll also protect your flour and rice from insect damage too.
If you live in a humid area and are simply wanting to keep your dry goods dry, then try using Mason jars. These are ideal for those bakers who use flour on a weekly basis. You can add an oxygen absorber in the Mason jar - the primary job of an oxygen absorber "is" to absorb oxygen, as the name implies.
If you're looking for air-tight storage, use feed buckets with lids. Use 2000cc oxygen absorbers in buckets; they're perfect for this as they really ARE air-tight.
Great question! Look, I know it's hard to find space in closets, but they are ideal. Why? They are dark (so that keeps direct light off your dry goods. Both the bins and buckets are great for stacking too. Put the heavier goods at the bottom of the pile so they're not "top heavy." They hurt when they fall on you. Ask me know I know.
You can safely stack around 5 plastic lidded bins; and about 4 buckets in a tower. I could only manage 4 buckets because I'm only a tad over five feet tall! Again, keep the heavier buckets on the bottom. They don't take up too much room in the closet. I look at it this way: you can eat flour and beans, but you can't eat clothes.