How a Terrarium Works: The Science of a Closed System

A sealed terrarium is a miniature ecosystem that recycles its own water, air, and nutrients while drawing only light from the outside world. Once you close the lid, plants photosynthesize using sunlight and carbon dioxide, release oxygen and water vapor, and then reabsorb that same water and gas as the cycle repeats. The soil, the glass, and the organisms inside form a loop that can sustain itself for months or even years without being opened. The science behind it is surprisingly rich, touching on thermodynamics, microbiology, and the same principles that keep our entire planet livable.

The Water Cycle in Miniature

Water is the most visible cycle inside a terrarium. When you first seal the container, moisture in the soil and on plant leaves begins to evaporate. Because the glass is sealed, that water vapor has nowhere to go. It rises, hits the cooler walls or lid of the container, and condenses into tiny droplets. Those droplets run back down into the soil, where roots absorb them again, and the process starts over. You can literally watch this happen on the inside of the glass, especially when the terrarium sits in a warm spot during the day and cools down at night.

This is essentially the same water cycle that operates across the planet, compressed into a jar. Evaporation, condensation, and precipitation all occur, just on a scale measured in centimeters rather than kilometers. The key difference is that Earth’s water cycle is driven by massive temperature differentials between the equator and the poles, ocean currents, and atmospheric circulation. In a terrarium, the temperature differential between the sun-warmed interior and the slightly cooler glass walls is enough to keep the cycle turning. The total amount of water inside the system never changes, it just moves between states and locations.

Gas Exchange and the Carbon Cycle

If the water cycle is the most visible process in a sealed terrarium, the gas exchange between plants and microorganisms is the most critical. Plants take in carbon dioxide and water, use light energy to convert them into sugars, and release oxygen as a byproduct. That oxygen is then used by soil bacteria, fungi, and other microorganisms as they break down dead leaves, roots, and other organic matter. This decomposition releases carbon dioxide back into the terrarium’s atmosphere, completing the loop.

The balance between these two processes is what makes the terrarium work. If plants produced oxygen but nothing consumed it, the gas composition inside the jar would drift until conditions became inhospitable. If decomposers produced carbon dioxide but nothing absorbed it, the same thing would happen in reverse. In a healthy terrarium, these two halves of the cycle roughly match each other’s pace, keeping the internal atmosphere stable enough for everything to survive.

This is also where the soil does more than just anchor roots. Soil in a terrarium hosts bacteria, fungi, springtails, and other tiny organisms that serve as the system’s recycling crew. Dead plant material falls to the soil surface, decomposes, and its nutrients are released back into the soil where living roots can absorb them. Without this decomposition, the terrarium would eventually choke on its own dead matter and run out of the nutrients plants need to grow.

Why Humidity Stays So High Inside

The air inside a sealed terrarium quickly reaches very high relative humidity, often near saturation. This happens because evaporation from soil and plant transpiration continuously add water vapor to a small, enclosed volume of air. With no ventilation, that moisture accumulates until the air can hold almost no more. For the plants inside, this is mostly a good thing. Research on plants grown in enclosed environments has shown that high relative humidity helps maintain water balance in leaves, supports photosynthesis, and reduces the risk of leaf burn compared to plants grown under drier conditions.1PubMed Central. High relative humidity improves leaf burn resistance in flowering Chinese cabbage seedlings cultured in a closed plant factory

High humidity also means that plants inside a terrarium do not need to work as hard to retain water. In open air, plants lose water through tiny pores in their leaves called stomata. When the air is humid, the difference in moisture between the inside of the leaf and the surrounding air is small, so less water escapes. This is one reason tropical plants with thin, moisture-loving leaves tend to thrive in sealed terrariums while succulents and desert plants do not. Succulents are adapted to conserve water in dry environments, and the relentless moisture of a sealed terrarium often leads to rot and fungal problems for them.

Light Is the Only Thing That Enters

A properly sealed terrarium exchanges no matter with the outside world. No water goes in or out, no air is exchanged, no nutrients are added. The only thing that crosses the glass is light energy. Sunlight passes through the glass, is absorbed by plant leaves, and drives photosynthesis. This is the energy input that powers the entire system. Without it, plants cannot fix carbon, the water cycle slows because there is less heat to drive evaporation, and the whole thing winds down.

This makes a terrarium what scientists call a materially closed but energetically open system. The Earth itself works the same way at a grand scale. To a first approximation, our planet is closed to the flow of matter, though small amounts of meteoritic dust arrive and tiny quantities of hydrogen and helium escape from the upper atmosphere. But there is a constant inflow of solar energy and a constant outflow of heat radiated to space.2Advances in Space Research. Closure as a scientific concept and its application to ecosystem ecology and the science of the biosphere A terrarium mirrors this arrangement almost exactly: matter stays inside, energy flows through.

The type and intensity of light matters more than many terrarium builders realize. Direct midday sun through a glass container can heat the interior to lethal temperatures in minutes, essentially turning the terrarium into a greenhouse within a greenhouse. Bright indirect light, or light from a grow lamp placed a reasonable distance away, provides enough energy for photosynthesis without cooking the plants. The glass itself also filters out some ultraviolet wavelengths, which slightly changes the quality of light reaching the leaves compared to what they would receive outdoors.

What Happens in the Soil

The soil layer in a terrarium is far more than a growing medium. It is the system’s nutrient bank, water reservoir, and primary site of decomposition. When leaves drop or roots die, soil-dwelling bacteria and fungi break down the organic material and release nitrogen, phosphorus, potassium, and other elements back into a form that living plant roots can absorb. This nutrient cycling is what allows a terrarium to persist without fertilizer.

Carbon dioxide levels in terrarium soil can be substantially higher than in the open atmosphere, because decomposition is actively producing COâ‚‚ in a confined space. Research on enclosed growing environments has found that elevated soil COâ‚‚ can slightly lower soil pH, though the effect is often modest and within a range that most plants tolerate well.3PubMed Central. Impact assessment of high soil CO2 on plant growth and soil environment: a greenhouse study In a terrarium, the relatively thin soil layer and the constant movement of gases between soil and the air space above it keep conditions from drifting too far in one direction.

The drainage layer at the bottom of most terrariums, typically pebbles or expanded clay balls with a charcoal layer above, serves an important purpose in this closed system. Because excess water cannot drain out, standing water at the root zone would create anaerobic conditions where harmful bacteria thrive. The drainage layer gives excess water somewhere to collect away from roots, while activated charcoal helps adsorb compounds that might otherwise build up and become toxic over time.

Why Some Sealed Terrariums Fail

Given how elegantly the cycles interlock, it is reasonable to wonder why sealed terrariums ever fail. The most common reason is that the system never reaches equilibrium. If too much water is added at the start, the soil stays waterlogged, roots rot, and fungal growth overwhelms the plants before the cycle can stabilize. If too little water is present, the humidity drops, transpiration stresses the plants, and the water cycle cannot sustain itself.

Overplanting is another frequent culprit. Too many plants in a small container consume more oxygen at night (through respiration) and more carbon dioxide during the day than the system can replenish, creating wild swings in gas composition. A thriving sealed terrarium usually has fewer plants than a new builder expects, with plenty of open soil surface for mosses and microorganisms to do their work.

Mold and fungal overgrowth are also common in the early weeks of a new terrarium. This is not always a crisis. Decomposer fungi are a normal and necessary part of the ecosystem. In many cases, an initial flush of mold will consume whatever readily available organic matter was present in the soil or on plant surfaces and then die back as that food source is exhausted. Persistent, spreading mold usually signals too much moisture, too little light, or the presence of material that should not have been included, such as untreated wood that rots quickly in wet conditions.

The Wardian Case and the Accidental Beginning

The idea of growing plants in a sealed glass container dates back to 1829, when a London physician named Nathaniel Bagshaw Ward noticed ferns sprouting inside a sealed jar he had been using for an unrelated experiment with moths. His observation led to the invention of the Wardian case, a simple glazed box that allowed living plants to be shipped across oceans without the salt spray, temperature swings, and erratic watering that had previously killed most botanical cargo in transit.4Environment and History. The Wardian Case: Environmental Histories of a Box for Moving Plant

The Wardian case worked precisely because it was a closed system. Water transpired from leaves, condensed on the glass, and ran back into the soil. The plants inside were buffered from the extreme conditions outside. This simple technology had outsized consequences: it enabled the mass transfer of economically important plants between continents during the nineteenth and early twentieth centuries, reshaping agriculture and landscapes on a global scale. Tea plants moved from China to India, rubber trees from South America to Southeast Asia, and countless ornamental species traveled between continents, all surviving journeys that would have killed unprotected specimens. The modern terrarium is a direct descendant of Ward’s accidental discovery.

Open Versus Closed Terrariums

Not everything commonly called a terrarium is a closed system. Open terrariums, those without lids or with large openings, do not recycle water or maintain their own humidity. They lose moisture to evaporation and require regular watering, making them closer to a potted plant in a decorative container than to a self-sustaining ecosystem. The science of a closed system simply does not apply to them.

Open terrariums are better suited for plants that prefer drier conditions, such as succulents, cacti, and air plants. These species would suffer in the humid, still air of a sealed container. The trade-off is that open terrariums demand ongoing care. You are managing the water, nutrients, and conditions yourself rather than letting the sealed system manage them. The appeal of a closed terrarium is specifically that, once balanced, it becomes self-maintaining. The appeal of an open one is aesthetic flexibility with a wider range of plants.

There is a middle ground that some builders use: containers with small openings or loose-fitting lids that allow some air exchange while still retaining most humidity. These semi-closed systems are more forgiving of initial overwatering because excess moisture can slowly escape, but they also require occasional topping up of water as the system loses it. They behave like a leaky version of the closed model, with the same internal cycles operating but with a slow drain that needs periodic correction.

Earth, Biospheres, and the Limits of the Analogy

Researchers working on life-support systems for space habitats have long recognized the parallels between sealed terrariums and our own planet. Both are materially closed and energetically open. Both depend on biological cycles to renew water, recycle carbon, and maintain a breathable atmosphere. The difference is scale and complexity. Earth has oceans, a magnetosphere, plate tectonics, and billions of interacting species buffering its systems. A terrarium has a handful of plants, some soil microbes, and a thin layer of gravel.

Work on bioregenerative life-support systems, the kind envisioned for long-duration space missions, has made this parallel explicit. Researchers have noted that the small volumes and fast cycling times in artificial closed ecosystems make it starkly clear that water and atmosphere must be continuously renewed, nutrients recycled, and environmental conditions actively managed.5Advances in Space Research. Earth Applications of Closed Ecological Systems: Relevance to the Development of Sustainability in Our Global Biosphere In a terrarium, if the nutrient cycle breaks down, you see the effects within weeks. On Earth, the buffering capacity of oceans and forests can mask similar breakdowns for decades, but the underlying physics is the same.

This is also where the terrarium analogy has practical teaching value. Watching condensation form on glass, seeing dead leaves slowly disappear into soil, and noticing that plants continue to grow without any input except light makes abstract concepts like the carbon cycle and water cycle tangible in a way that diagrams rarely achieve. The reason a sealed jar of plants can sit on a shelf for years without attention is the same reason Earth has supported life for billions of years: energy flows in, matter cycles within, and biological processes keep the chemistry in a range where living things can persist.

Choosing Plants That Actually Work

Not every plant belongs in a sealed terrarium, and the choice of species matters more than most other design decisions. The ideal candidates are small, slow-growing plants adapted to warm, humid, low-light conditions. Tropical understory plants fit this description almost perfectly, which is why ferns, mosses, fittonias, and small-leaved tropical creepers dominate successful closed terrariums.

Fast-growing plants can overwhelm a small container in weeks, pressing against the glass, shading out their neighbors, and dying back in ways that dump large amounts of decomposing material into the system all at once. Slow growers give the system time to reach and maintain equilibrium. Similarly, plants that need intense direct light are poor candidates because the light levels that would satisfy them would also overheat the enclosed air.

Mosses deserve special mention because they play a dual role. They photosynthesize and produce oxygen like any other plant, but they also act as a living sponge on the soil surface, absorbing and slowly releasing moisture in a way that stabilizes humidity fluctuations. A terrarium with a healthy moss layer tends to be more resilient than one with bare soil between larger plants. Springtails, tiny arthropods often added deliberately by experienced terrarium builders, serve a similar stabilizing function on the decomposition side. They consume mold and decaying organic matter, helping prevent the kind of fungal explosions that derail young terrariums.