Methane is an odorless, colorless simple hydrocarbon with the chemical formula CH4. It is the major component of natural gas, used to produce energy through combustion. It was found on many planets, including Earth.
Natural sources
The atmosphere of a class K planet, such as Theta VIII, consists of methane, nitrogen, and liquid neon. (TNG: "The Royale")
The Axanar breathed a nitrogen-methane atmosphere. (ENT: "Fight or Flight")
Many planets contained trace amounts of methane in their atmospheres. The USS Enterprise detected such trace amounts during scans of Persephone III, Prospect VII, Rigel VII, Valeo Beta V, Cajitar IV, Finibus III, and Skygowan. (SNW: "Children of the Comet", "Lift Us Where Suffering Cannot Reach", "Among the Lotus Eaters", "All Those Who Wander", "New Life and New Civilizations", and more)
The USS Farragut detected trace amounts of methane in the atmosphere of Helicon Gamma, before the planet's destruction. (SNW: "The Sehlat Who Ate Its Tail")
The atmosphere of Tezaar was 0.9% methane. (SNW: "Four-and-a-Half Vulcans")
The surface of the planet Alpha Onias III contained high, but non-toxic, levels of sulfur dioxide, methane, and hydrogen sulfide. (TNG: "Future Imperfect")
In 2370, the USS Enterprise-D inspected the vessel USS Raman via an interface probe controlled by Geordi La Forge. The probe entered a hull breach in the aft section of the Raman and detected atmospheric gases from the planet Marijne VII inside the corridor – primarily methane and ammonia. (TNG: "Interface")
In an alternate timeline where the Borg assimilated Earth after stopping Zefram Cochrane's warp flight, the planet had an atmosphere of methane, carbon monoxide, and fluorine in 2373. (Star Trek: First Contact)
A class 6 gas giant encountered by Voyager in 2375 had a layer of liquid hydrogen and methane ten thousand kilometers below the outer atmosphere. (VOY: "Extreme Risk")
In the 32nd century, trace amounts of methane could be detected in the atmosphere of Betazed. (SA: "300th Night")
Non-natural occurrences
In 2022, Sera told La'An Noonien-Singh and an alternate version of James T. Kirk that various natural gas explosions were actually alien attacks meant to impede Human progress. Ironically, Sera herself was not a conspiracy theorist but a Romulan agent sent from the future with just that objective. (SNW: "Tomorrow and Tomorrow and Tomorrow")
In 2151, the Klingon courier Klaang led two Suliban pursuers into a grain silo on Earth, owned by a farmer named Moore. The silo contained methane, which Klaang detonated behind him, killing the Suliban. (ENT: "Broken Bow")
In 2364, an accidental explosion from a methane-like gas occurred on the colony on Quadra Sigma III. (TNG: "Hide And Q")
There were traces of potassium nitrate, ammonium, and methane in the back of a truck the USS Voyager found drifting in space in 2371. Kathryn Janeway identified it as horse manure. (VOY: "The 37's")