"You're the captain of this ship. You haven't the right to be vulnerable in the eyes of the crew. You can't afford the luxury of being anything less than perfect. If you do, they lose faith, and you lose command."

Captain was a commissioned officerrank, the equivalent of which was used by the service organizations of many civilizations. The title of captain was often used by vessel commanders and, as a naval rank, in many Earth navies and Starfleet, was above commander. As an infantry rank, captains ranked subordinate to a major and above a first lieutenant.

By the 20th century, the rank of captain was common in Earth militaries and was used by all branches of service in the United States armed forces. The rank of captain was represented by a double rectangular silver bar uniform insignia for ground units and the equivalent of a colonel's eagle for naval captains. In 2364, the Q-entity took the form of a US Marine Corps captain when confronting Captain Picard. In this disguise, Q was quoted as stating "All it takes is a few good men." Q also appeared as a 16th centurysea captain to the crew. (TNG: "Encounter at Farpoint") In the US Navy, the rank of Captain was specifically that of the superior officer of a ship, whereas in the other branches – being land or air based and not having ships – it was just another officer rank.

The rank of captain was also used by World War IIGermany. In the German army, the rank was translated as Hauptmann (headman), but in the SS, company captains were referred to as Hauptsturmführer ("head storm leader"). The collar insignia for this was a black square bordered with white, with three silver pips in a diagonal line, with two stripes underneath.

The Nazi captain in "The Killing Game" was played by J. Paul Boehmer. He was billed as the SS Kapitän, although his rank insignia was that of a Hauptsturmführer. In ENT: "Storm Front", Boehmer wore the same uniform, but with Untersturmführer insignia, this time credited as "SS Agent".

Captains of starships, often located hundreds of light years away from and out of communications with higher authority, needed to be able to function autonomously and make independent command decisions affecting Federation policy and countless lives. Accordingly, few Starfleet officers ever gained the captaincy of a starship, the result of decades of sustained excellence as a Starfleet leader.

A senior captain given a large degree of responsibility or administrative assignment was sometimes given the title of fleet captain.

Although Scotty was given the title "Captain of Engineering," he was still wearing commander's insignia in Star Trek III: The Search for Spock. He was seen wearing both captain's and commander's insignia in Star Trek IV: The Voyage Home, possibly indicating, though never mentioned on-screen, that Scotty was either frocked or promoted to the rank of captain, despite his taking part in the hijacking of the Enterprise.

Krasnovsky is the only character in Star Trek to be seen wearing a sciences uniform while holding the rank of captain, while Jadzia Dax and Spock held the title of captain in a sciences uniform, but not the actual rank. Leonard McCoy also presumably once held the rank, since he was an admiral in 2364, but wasn't seen in a uniform.

The actors who have appeared in lead roles as Star Trek captains on television have been extremely varied. Jonathan Frakes remarked, "The five captains are so distinctive because of the five actors that play them, obviously. Patrick [Stewart] was cast against type, coming after Bill [Shatner]. Avery [Brooks], quite obviously, was cast against type, coming after Patrick. It was smart to bring Kate [Mulgrew] in, as a woman, and then Scott [Bakula] had an entire charm of his own. I think [...] whether it was planned or not, it was a very successful endeavor." (The Captains)

The Bajoran Militia, which also used army rank names, has been referred to by the Star Trek Encyclopedia as having a captain grade, with an insignia seen in episodes on officers subordinate to MajorKira Nerys, although they were never referred to by any specific rank in canon productions or materials.