A democracy is a form of government, which literally means "rule by the people," by the means of achieving a consensus through casting votes. In a representative democracy, also known as a representative republic, holders of political office are chosen by election.
Following the fall of the Second Dynasty in the 16th century, the Klingon Empire was ruled by a council elected by the people. This was the first and only experiment in Klingon democracy and was known for producing several notable reforms. 24th century Klingon historians were critical of the period, naming it "The Dark Time". The experiment ended after ten years with the beginning of the Third Dynasty. (DS9: "You Are Cordially Invited")
The inhabitants of Platonius followed the teachings of Plato, with a few adaptations, however, their society was, according to Parmen, "the most democratic society conceivable." He further stated that "anyone can, at any moment, be or do anything he wishes, even to becoming ruler of Platonius if his mind is strong enough." (TOS: "Plato's Stepchildren")
The Federation itself was of a democratic body. During the first Klingon-Federation War, Commander Kor told Captain James T. Kirk that he felt that the people of the Federation were much like the Klingons. Kirk noted that unlike the Klingon Empire, the Federation was a democracy, however, Kor clarified that he was not referring to "minor ideological differences," but instead meant similar "as a species". (TOS: "Errand of Mercy")
When the USS Enterprise was cornered by a First Federation buoy, the panicked Lieutenant Dave Bailey exclaimed to Captain Kirk that they had phaser weapons, and that he voted they "blast it." Kirk, however, felt otherwise, stating, "I'll keep that in mind, Mr. Bailey, when this becomes a democracy." (TOS: "The Corbomite Maneuver")
During Captain Kathryn Janeway's plan to form an alliance with the Kazon, Commander Chakotay voiced his opinion about how "a lot of the crew feel they haven't had the chance to voice their opinions" about the situation. Janeway, however, held to her decision, stating, "this isn't a democracy, Chakotay. I can't run this ship by consensus." (VOY: "Alliances")