I used to store these items in my cupboard, in various tupperware containers, decorative containers, boxes, you name it, I tried it. Recently I found these spice containers at IKEA and knew right away they'd work really well.
Incidentally, the new marker board is also an IKEA product that came with a hidden bonus-- it holds my DIY keyboard PERFECTLY!! Hurray!
The lids screw on, so they won't come off when stored vertically. The backs of the containers are magnetized.