In episodic television, a bottle episode is produced inexpensively and restricted in scope to use as few non-regular cast members, effects, and sets as possible. Most bottle episodes are shot on sets already built for other episodes, frequently the main interior sets for a series, and consist largely of dialogue or scenes for which no special preparations are needed. They are also commonly used when one script has fallen through and another has to be written on very short notice. 
The etymology of the phrase originates with a similar term used on the set of the original 1960s Star Trek. Cast and crew members of the show use the phrase "ship-in-a-bottle episodes" for episodes that took place only on board the Starship Enterprise.
Bottle episodes are sometimes produced when a show has a mid-season cliffhanger or an expensive season opener/closer, serving to allow as much of the budget as possible to go to the more expensive episodes. Scott Brazil, executive producer/director of The Shield, described bottle episodes as "the sad little stepchild whose allowance is docked in order to buy big brother a new pair of sneaks". The popularity of the Friends bottle episode "The One Where No One's Ready" led the producers to create at least one bottle episode in each subsequent season. Several early episodes of The X-Files were conceived as bottle episodes, including "Space", "Darkness Falls", and the well-received "Ice", although these often ran over budget nevertheless.
Bottle episodes from the Star Trek franchise are known for occasionally becoming among the most popular with fans. Prominent examples include "The Tholian Web", "Journey to Babel", and "Balance of Terror". The phenomenon has persisted to a lesser extent in later incarnations, with "Duet" (Star Trek: Deep Space Nine) being celebrated by Startrek.com and Amazon.com—among other sources—as "[a]rguably one of the best episodes of Deep Space Nine and a jewel in the entire Trek canon".
Although Star Trek is known for coming up with the term "bottle episodes", it was not the first show, science fiction or otherwise, to use them. The third ever story of Doctor Who, "The Edge of Destruction", was a bottle episode created in different circumstances to most, as the previous two stories had been eleven episodes between them and, as the series had not been formally picked up by the BBC, a two part story was needed and no budget had been assigned. It only featured the four main cast.  Doctor Who has had several more bottle episodes since then, most notably, "Amy's Choice". Although some scenes were filmed on location, within the narrative of the show, the whole episode takes place completely within the TARDIS.
On Breaking Bad, the third-season" episode "Fly" features only two members of the main cast (plus a few extras) and takes place almost exclusively in the secret laboratory used to cook crystal methamphetamine. Series creator Vince Gilligan has referred to this as a bottle episode, noting that the limited setting and cast allowed for a slower pace and deeper exploration of character traits and motives:
Even if financial realities didn't enter into it, I feel as a showrunner that there should be a certain shape and pace to each season, and the really high highs that you try to get to at the end of a season — the big dramatic moments of action and violence, the big operatic moments you're striving for — I don't think would land as hard if you didn't have the moments of quiet that came before them. The quiet episodes make the tenser, more dramatic episodes pop even more than they usually would just by their contrast.
In Penny Dreadful Season 3, Episode 4, Vanessa Ives and John Clare share the padded white room at a Victorian insane asylum for nearly the entire episode, breaking away for brief scenes with Dr. Seward in her office, as well as Seward briefly appearing in the padded room at the Banning asylum. The episode takes place as a hypnotic recollection. Rory Kinnear, the actor playing Clare, also plays two other characters. There are brief but key special effects.
Miranda's Season 2, Episode 5, "Just Act Normal", takes place entirely in a therapist's office and consists of only three main characters, one of whom makes a cameo at the end, and two guest stars.
Family Guy's Season 8, Episode 17, "Brian & Stewie", takes place almost entirely inside a bank vault, with just two animated characters (Brian, the anthropomorphic dog, and Stewie, a troubled and intelligent baby) there for an entire weekend. The episode begins with Brian and Stewie introducing the special story and ends with a few special re-run musical numbers. This was a bottle episode not for budgeting reasons, but as an experiment with both the two characters' relationship and the viewing audience. The audience was receptive of the special episode and seemed to enjoy another step in the development of the characters' friendship.
The Season 1 finale of Married... with Children, "Johnny Be Gone", takes place entirely in the Bundys' living room, as Al and Peg unsuccessfully attempt to leave for the "going out of business" party of their favorite burger joint, where they first met.
The comedy-drama series Leverage had three bottle episodes. "The Bottle Job," from Season 2, is confined to Nathan Ford's (Timothy Hutton) apartment; McRory's, the bar it sits over; and the bar's back room. It alludes to the concept by forcing the Leverage team to execute a late betting scam, which normally takes days or weeks just to set up, in only an hour and a half; Ford explicitly calls it "the Wire in a bottle." (Ford, a recovering alcoholic, also reverts to drinking as part of the scam; "hitting the bottle" is an expression for heavy drinking.) In Season 4's "The Cross My Heart Job," the team is stuck at an airport without access to any of their usual equipment, funds, or cover identities, and is tasked with stealing a transplant heart for a 15-year-old boy. "The Broken Wing Job" focuses on Parker (Beth Riesgraf) foiling a kidnapping while she recuperates from a broken leg and the rest of the team is in Japan on an assignment.
The drama series Supernatural had in season 11 a bottle episode, titled "Baby", in which the entire episode takes place inside the Impala, the car they ride since the first episode in season 1. However, unlike other bottle episodes, the characters do leave the car on multiple occasions. The camera itself, however, remains within the car throughout the entirety of the episode.
A meta-example is Community's Season 2, Episode 8, "Cooperative Calligraphy". After the opening, characters Jeff Winger (Joel McHale) and Abed Nadir (Danny Pudi) both refer to the situation as a bottle episode. The entire episode is set inside the college library with only the main cast.
Another meta-example is Teen Titans Go!'s Season 3, Episode 29, "Bottle Episode". Its plot centers around the main characters being trapped in a literal glass bottle, and passing the time by reminiscing about previous episodes. The episode breaks the fourth wall multiple times with dialogue referencing the expense of television production, giving production staff a break, and the need to fill episodes that fall through.
There are also entire series that are essentially made up of bottle episodes, such as Blackadder II. After the previous series, The Black Adder, proved to be more expensive than the BBC wanted, to get the second series commissioned the writers Richard Curtis and Ben Elton arranged to cut every single expensive scene and to make the cheapest series possible. Another earlier BBC series that similarly consists almost entirely of bottle episodes is Steptoe and Son.
- "10 great TV Bottle Episodes". 2012-11-21.
- "What is a Bottle Episode?". wiseGEEK. Conjecture Corporation. Retrieved 2013-10-26.
The term originates from Star Trek, where a number of episodes took the form of bottle episodes. The crew of the show came to refer to such episodes as 'ship in a bottle' episodes, referencing the fact that they typically took place on board the Starship Enterprise, and the term 'bottle episode' caught on more widely in the television industry. These episodes are also sometimes called 'bottleneck episodes,' referencing the constricted budget available to the crew.
- "Episode 410 "Back In The Hole"". fxnetworks.com. 2005-10-31. Archived from the original on 2005-10-31. Retrieved 2011-07-31.
- Bright, Kevin S. (2005). Friends: Final Thoughts (DVD). New Wave DVD and Warner Home Entertainment.
- Lowry, pp.121–122
- Edwards, p.71
- Goldman, p.94
- Edwards, p.45
- "Star Trek Database". Startrek.com. Retrieved 2010-08-29.
- "Star Trek - Deep Space Nine, Episode 19: Duet". Amazon.com. Retrieved 2010-08-29.
- "BBC - Doctor Who Classic Episode Guide - The Edge of Destruction - Details". bbc.co.uk.
- "News & Reviews: - Breaking Bad: "Fly" Review". Paczkowski.tumblr.com. Retrieved 2011-07-31.
- Murray, Noel (2010-06-13). "Interview with Vince Gilligan". The A.V. Club. Retrieved 2011-07-31.
- Framke, Caroline (2015-02-05). "Archer: "Vision Quest"". The A.V. Club. Retrieved 2015-02-08.
- "Blackadder II - Timewarp (Blackadder Hall)". Blackadder Hall.
- Edwards, Ted (1996). X-Files Confidential. Little, Brown and Company. ISBN 0-316-21808-1.
- Goldman, Jane (1995). The X-Files Book of the Unexplained Volume I. HarperPrism. ISBN 0-06-168617-4.
- Lowry, Brian (1995). The Truth is Out There: The Official Guide to the X-Files. Harper Prism. ISBN 0-06-105330-9.