This page contains information regarding Star Trek: Lower Decks, and thus may contain spoilers.
A Dyson sphere is a colossal sphere constructed around a star, completely surrounding it. The interior of the sphere would absorb the entire energy output of that star, allowing for lifeforms to live on the interior surface almost indefinitely. Such a structure was theorized by the 20th century physicist Freeman Dyson.
One of these spheres encased a G-type star and had a diameter of two hundred million kilometers (nearly the size of the orbit of Earth around Sol), giving it an internal surface area of approximately 250 million M-class planets. The exterior shell was composed of carbon-neutronium, and the interior was much like a habitable planet with various types of terrain and an atmosphere. The sphere was equipped with a portal with the diameter of several large starships which opened to allow ships to enter the interior, where there was enough room to orbit the star. Ships were guided through using tractor beam emitters triggered by subspace signals.
One settlement that could be seen near the portal was a vast metropolis by a large body of water and bordered on one side by a mountain range.
As no radiant sunlight or solar wind escaped from the sphere, and its sheer size created massive gravimetric interference that interfered with sensors, starships traveling at warp speed were not able to detect it unless they dropped out of warp within range of its massive gravitational field.
The resonance frequency of the sphere's tractor beams was incompatible with the power systems of Federation starships, exposure causing both warp engine relays and impulse engine relays to overload. While investigating the sphere while en route to the Norpin colony, the tractor beams damaged the USS Jenolan, causing it to crash onto it in 2294 after being pulled in by the sphere's immense gravity well. In 2369, the USS Enterprise-D discovered the Jenolan's distress signal and investigated the sphere. The sphere had been abandoned by its creators because the star around which it was constructed had become highly unstable. As of stardate 46125.3, Starfleet dispatched two science vessels to study the sphere. (TNG: "Relics")
When Ensign Sam Rutherford was obsessing over how Lieutenant Shaxs returned from the dead in 2381, one of the scenarios he envisioned was Shaxs being resurrected by a microscopic civilization seeking to harness the power of his body with a tiny Dyson sphere. (LD: "We'll Always Have Tom Paris")
The Dyson sphere, named after scientist Freeman Dyson, who envisioned a real-world postulate in 1959. However the actual "sphere" that Dyson theorized was not a solid object like the one visualized in the episode but, rather, a large number of constructs independently orbiting around the star in a dense formation.
Dyson himself never took his idea too seriously, and said in a later interview that, while the science behind it was "nonsense", as a TV viewer he enjoyed the episode.  More specifically, he called his theory a "joke." About "Relics", Dyson said "Actually it was sort of fun to watch it. It's all nonsense, but it's quite a good piece of cinema."  In the same interview, he said that "Stapledon sphere" would be a more appropriate name, in honor of Olaf Stapledon, whose depiction of such an object in his 1937 novel Star Maker inspired young Dyson to look into the theory. The type of solid structure depicted in the episode has also been referred to as a "Dyson Shell".
The concept of the Dyson sphere, as a B-story premise, had actually already been circulating among the writing staff for years, but until the episode "Relics", the opportunity had never arisen to utilize the notion. "It was something that we were trying to put in for a long time and it became a standing joke.", noted episode Writer Ronald D. Moore. Once "Relics" came up, the opportunity finally afforded itself and the episode's Science Consultant Naren Shankar went to work to beef out the concept, "I originally thought the interesting thing would be to make it a partially complete Dyson's Sphere. It ended up being a completed Dyson's Sphere that was uninhabited. When Ron had written about the Dyson's Sphere in the teaser, he wrote "tech" and I gave him the numbers for the size of it. He was shocked that it was so big. It was like the equivalent of four million earths. It's huge. If you build something the size of the [sic] sun's orbit, you're talking about a sphere with a diameter of two hundred million miles." (Cinefantastique, Vol. 24, issue 3/4, p. 27)
Dyson sphere maquettes
For the Star Trek episode, both exterior and interior maquettes were built at Gregory Jein, Inc., while the initial full-sized exterior view and interior long views were executed as matte paintings by Eric Chauvin. (Star Trek: The Next Generation Companion (3rd ed., p. 220)) The episode's visual effects supervisor David Stipes initially wanted to do the exterior approach scene in CGI. He envisioned the Enterprise approaching the sphere from a great distance, and when the sphere grew closer its initial smooth looking surface would resolve into a fantastically detailed network of structures against which the Enterprise would be dwarfed. "It would have been a perfect CGI shot", Stipes enthused, but budgetary considerations made the proposal unfeasible, causing him to sigh at the time, "Contrary to what people are saying about CGI, it's still not as cheap as doing a model" (Cinefantastique, Vol. 24, issue 3/4, p. 80) Stipes later elaborated, "At first we talked about generating it with computers. But we ran into some challenges, so we called in Greg Jein". Still, some use of computer aid was made as Stipes explained, continuing, "But Greg's model was huge. But we needed it to be a hundred feet long to give us the required scale. So the crew shot a selection of the panel and then digitally reproduced that section over and over, in cookie-cutter fashion, making things look like it stretched on for miles."
At his model shop, Jein and his team of modelers built two versions of the Dyson sphere surface, an exterior one, actually several of those for assembly into one huge exterior maquette, with one featuring the articulated access door, and an interior one. On constructing the maquettes, Jein recalled,
"The master pattern is made out of sections of a Japanese model kit. We cast them into a larger pattern and then made a rubber mold. Then we peeled it off and started pouring giant urethane bricks. We put the bricks on wooden frames and put the frames together once we got to the stage. (…) The exterior was pretty straight forward, because all the panels were the same except for the door. We had more fun with the interior, because we made it look like an industrial city block. We put our high school names in some of the buildings, like "Dorsey High School", but the audiences never saw that. We used a lot of pieces out of "central casting" – that's what we call our stock molds that have lots of detail in them – to break up the surface so that each panel wasn't exactly the same. I carved the main core around the door out of foam because we didn't have time to make molds; It's sort of free-form." (Star Trek: The Next Generation 365, p. 275)
Two additional specialty maquettes were constructed for particular close-up scenes, a more detailed enlarged one of the exterior surface to go with the USS Jenolan studio model in order to depict its crash site, and a detailed interior airlock corridor maquette for close-ups of the escaping USS Enterprise-D. For the interior airlock maquette, Jein and his team used parts and pieces he kept lying around in his model shop as stock. "We used some left over running ship parts to make the corridor from the interior of the Dyson's Sphere to the exterior, so the justification for hoarding all those parts these last 20 odd years finally paid off.", Jein clarified. (Cinefantastique, Vol. 24, issue 3/4, p. 27)
The effects footage shot for this occasion of the interior airlock corridor, was later reused in the Star Trek: Voyager second season episode "Non Sequitur". In that episode, it was supposed to represent the (much smaller) spacedock doors, through which Ensign Harry Kim in an alternate timeline was escaping (in the opposite direction) aboard a commandeered Yellowstone-class runabout. The visual effects stock footage for that scene was newly composited in post-production at CIS Hollywood.
Penny Juday endeavored to give insight into the creation of the interior maquette model by trying to explain the technique of "kitbashing" in the TNG Season 2 DVD-special feature, "Inside Starfleet Archives … Penny Juday, Star Trek Coordinator". According to Juday, the art department produced similar structures on several other occasions, combining them on a large board. Neither the exterior maquette panels nor the two specialty maquettes were ever sighted again, having more than likely been discarded, as was usual with episode-specific production pieces this large. Against all odds however, the resin-and-plywood interior maquette, measuring 84 inches square, survived long enough to end up in the 40 Years of Star Trek: The Collection auction as Lot 690, estimated at US$800-$1,200, where it sold for US$5,000 ($6,000 including buyer's premium) on 7 October 2006.
In book #5 of the Double Helix series (Double or Nothing) Captains Calhoun and Picard encounter a Dyson sphere constructed by an anti-Federation alliance. Calhoun and Picard eventually succeed in thwarting the alliance and destroying the sphere.
In the Deep Space Nine Millennium book series, Chief O'Brien is briefly trapped in a Pah-wraith Hell where he is forced to wander the interior of a Dyson sphere for several millennia, unable to understand how the sphere was constructed or learn anything about its creation.
In The Starless World, Kirk and crew encounter a Dyson sphere that surrounds and is controlled by a god-like entity. The sphere has been traveling towards the galactic core for several billion years at sub-light speed and intends to enter a black hole as part of an ancient compact.
In season eight of Star Trek Online, players battle the Voth for control of a Dyson sphere in the Delta Quadrant which formerly belonged to the Solanogen-based lifeforms (referred to as the "Solanae" in the game) seen in the TNG episode "Schisms". The player also learns that the Dyson sphere encountered by the Enterprise-D in "Relics" (referred to as the Jenolan Dyson sphere) has disappeared without a trace, along with the science team analyzing it. It is later found that both spheres generate and utilize Omega particles to power a form of propulsion for each sphere; this form of propulsion caused the Jenolan sphere to "jump" further into the Delta Quadrant. In the Season 8.5 episode "A Step Between Stars", the player character and Tuvok rediscover the Jenolan sphere and the ship studying it while trying to shut down a device on the Solanae sphere. The rediscovery causes a schism between the Federation, the Klingon Empire and the Romulan Republic, and the summit to discuss it allows the Undine to invade Sol. The sphere is ultimately discovered to have traveled to the Nekrit Expanse, and serves home base to a multinational task force in the Delta Rising expansion. In the episode "Uneasy Allies", its revealed that another Dyson sphere, the Andromeda Dyson sphere (or Herald Dyson sphere), was located in the Andromeda Galaxy and was inhabited by the Iconian species alongside with their Herald servants. Later, using the same propulsion system as the Jenolan's, the Andromeda sphere jumped into the Milky Way Galaxy, more precisely to a point in the Iconia system.
In the Star Fleet Battles gaming universe, the Tholian Holdfast is depicted as having migrated to our galaxy by transporting their home world which is described to be similar to a mobile Dyson sphere.