"pepper-box," 1670s, from pepper (n.) + caster (n.1). As a colloquial term for an early and clumsy form of revolver with a long cylinder, by 1889.
Entries linking to pepper-caster
pepper n.
"dried berries of the pepper plant," Middle English peper, from Old English pipor, from an early West Germanic borrowing of Latin piper "pepper," from Greek piperi, probably (via Persian) from Middle Indic pippari, from Sanskrit pippali "long pepper." The Latin word is the source of German Pfeffer, Italian pepe, French poivre, Old Church Slavonic pipru, Lithuanian pipiras, Old Irish piobhar, Welsh pybyr, etc.
Application to fruits of the Capsicum family (unrelated, originally native of tropical America) is from 16c. To have pepper in the nose in Middle English was "to be supercilious or unapproachable."
caster n.1
also sometimes castor, "person or thing that casts," late 14c., agent noun from cast (v.). The meaning "pepper shaker, small perforated container" is from 1670s, on the notion of something that "throws" the powder, liquid, etc., when needed.