A few miles north of Portland, Maine, inside Allagash Brewing Company's gleaming fluorescent-lit beer factory, a heavy door leads into a climate-controlled room lined with barrels full of aging beer. Past those barrels, behind a second, smaller door, is one of craft brewing's most sacred spaces. In here, the thrumming industrial drone of bottling lines and keg washers fades away. Wooden casks stand silent sentry. Dust hangs heavy. Cobwebs lilt. The owner of Allagash, Rob Tod, sets a small green bottle of beer on an upturned cask. Its contents were aged in this very room. He pops the cork and pours a fragrant, foamy measure into a yellow plastic KOA coffee mug.

It's called Resurgam—Latin for “I shall rise again”—and it is the most remarkable beer I've ever tasted: vibrant, alive with sweet white-pear notes, a clean, tart razor's edge, and a subtle berry finish. It is at once fruity and earthy, rich and light, hazy and bright—strawberries in hay under a summer sun. Complex and graceful, Resurgam and the rare few beers like it represent a style of beer that's flatly, even belittlingly, called sour.

Behind the brewery, Allagash's brewmaster, Jason Perkins, leads me to a wooden shed. Inside, a shallow stainless-steel pool nearly fills a wood-paneled room. That pool is called a koelschip, and it's the key to Resurgam's complexity, the place where protobeer comes into contact with the horde of wild microbes that will ferment it into something special. “We don't use chemicals in here,” Perkins says, pointing out a filmy ring of grime around the tub. They clean with hot water, lest they interrupt the magic of the Maine microbes that make Allagash's sour beers its own.

The hut is a shrine to localism, its wood reclaimed from trees cut down when the brewery expanded, its windows from an old church in town, its door from a nearby salvage yard, and its dirt blown in from the forest outside. Perkins and the other Allagash brewers want to capture where they are: the crisp air, the faint sea breeze, the spirit of the Maine woods. “We model our brewing after lambic production,” Perkins says, referring to the famous sour beers of Belgium. “But we were curious: If we did the same thing in a different part of the world, what would happen?”

The answer was Allagash's line of sours. Launched in 2007, they were the first lambic-style brews made in the United States. They're available only at the brewery, and new batches sell out within days. It's a cult-like devotion common in the sour world. Online beer forums are drool-sodden with reviews of unusual, expensive bottles and poetic descriptions of flavors and aromas like dandelion, unripe pear, green pineapple, and even “liquid farmyard,” “rotten oak,” and “crap-stained muck-spreader.” (The more masochistic the tasting notes, the higher the price tag.) According to the mythology surrounding lambics, the particular combination of microbes that makes those flavors possible—various species of yeast and other microbes that show up almost accidentally during a brewing process known as spontaneous fermentation—exists only in a few locations on Earth: the bright, perpetually autumnal Maine woods, for example. But above all, the verdant cherry orchards of the Zenne River Valley, southwest of Brussels. (When the city's famed sour brewery Cantillon updated its 115-year-old brewhouse, it saved the old ceiling tiles, because the brewers hoped the critical microflora were contained therein.)

William Bostwick About William Bostwick (@brewerstale) writes, bakes, and brews in San Francisco. Parts of this story appear in his book The Brewer's Tale.

Call it microbial terroir. In winemaking, terroir refers to characteristic flavor that comes from where the grapes were grown and the wine was made. It is geography we can taste, whether it's the limestone-laden soil of the Champagne hills or the cherry-scented air on a spring day in Brussels. But if microbial terroir defines a sour beer's destiny, then understanding the biology of those microorganisms should be enough to let anyone manufacture as good a sour as Allagash or Cantillon. I don't live in the woods—I make beer on a chipped four-burner, five stories above San Francisco's Mission District. To purists, making a sour here would be like growing world-class Pinot in Times Square. The best way to find out if they're right: brew one myself.

Wooden ceilings at Allagash are home to its sour-defining microbes. Courtesy of Mathew Trogner

Before Louis Pasteur uncovered the microbial basics of fermentation, the creation of beer seemed magical. For centuries, the microflora that turn vegetables to pickles, milk to yogurt, and grain porridge to beer—each process a kind of fermentation—were revered and unknown. Brewing was the domain of ritual and prayer. An early term for yeast, the then-unknown stuff that turned boiled grain into beer, was Goddesgoode—“God is good.” Today, of course, foodies know they have Lactobacillus, lactic-acid-making bacteria, to thank for pickles and yogurt, and a species of yeast called Saccharomyces cerevisiae to credit for bread and beer. But over a century ago brewers figured out that another genus of yeast, Brettanomyces—a sign of spoilage in most beers—was responsible in part for the weird flavors in lambics.

Fermenting yeasts produce more than just ethanol and carbon dioxide. They make flavorful, aromatic molecules: acids and esters. But which ones make which ones? In the past the shortcut explanation was terroir—something about the location, the specific microorganisms native to a place. Even today no one has a better answer. “We know what the acids and esters are, and how they're made,” says Jim Withee, founder and CEO of GigaYeast, a beer yeast manufacturer in Belmont, California. “But not why—and most curiously, not what evolutionary and environmental advantage they have. Why has that genetic code adapted to that environment?”

If you believe the hype, the best wild beermaking microbes come from the golden fields of Belgium's Pajottenland—more specifically, the tiny town of Lembeek, an early medieval brewing hub. But until 2012 no one really knew which microbes. That's when a team of researchers applied modern genetic sequencing technologies to sour beers. They found quite a community and laid bare some of the secrets of the fabled lambic.

A brewer enters the shed that houses the brewery’s koelschip. Courtesy of Mathew Trogner

The first organisms to take root during fermentation, the researchers learned, are bad ones indeed: bacteria like Enterobacter cloacae (responsible for urinary tract infections) and Klebsiella pneumoniae (yes, like a respiratory infection). In theory they're dangerous. But they're only temporary tenants, doing their work and then dying before they can do any harm to fetishistic fans of sours. Among other compounds, they produce acetic acid—vinegar—which gives some lambics a pleasant tang. More than that, though, they break down polysaccharide sugars—those made of multiple subunits—into the smaller sugar molecules that yeast can digest.

That's what makes it possible for S. cerevisiae to move in. The carbon dioxide it makes bubbles away through the barrel staves; the ethanol stays. But yeast cells are smoky little engines that give off clouds of fragrant and flavorful molecules too. An enzyme in S. cerevisiae called alcohol acetyl transferase, for example, connects the alcohol with a molecule called acetyl-CoA to make banana-y isoamyl acetate and pearlike ethyl acetate.

When the yeast die, they make way for the next wave of organisms. Pediococcus—another genus of bacteria—teams up with Brettanomyces to eat the complex, longer sugar molecules that S. cerevisiae miss. Pediococcus produces lactic acid, lambic's dominant flavor note, but can also emit funkier flavors such as buttery diacetyl. And besides forming a goopy film on top called a pellicle, which allows it to access oxygen while sealing off the beer below, Brettanomyces also makes stuff like caprylic acid (goat smell) and ethyl lactate (horse-blanket smell). They're what make a farmhouse beer taste like a farm.

6 Great Sour Beers ——————

If you’re looking to try a sour beer but don’t want to hazard making your own, a few craft breweries have you covered. Here are some of my favorites.

—W.B.

Allagash Coolship Resurgam

Hometown: Portland, Maine

Alcohol by volume: 6.0–7.0 percent

Flavor notes: Sparkling bright, impossibly fresh, flaky strawberry shortcake spritzed with rose water

Russian River Beatification

Hometown: Santa Rosa, California

ABV: 5.5 percent

Flavor notes: Sharp and prickling, opens with zested grapefruit, closes with a slaty, tannic snap

Jolly Pumpkin Artisan Ales Bam Bière

Hometown: Dexter, Michigan

ABV: 4.5 percent

Flavor notes: Light, crisp, and crackling as sunburned straw, a twist of lemon, pure farmyard refreshment

Sam Adams KMF Grand Cru

Hometown: Boston, Massachusetts

ABV: 6.4 percent

Flavor notes: Dark and roasted, kissed with oak and basement-floor earth; sweet like sherry vinegar and chocolate sauce

Cantillon Rosé de Gambrinus

Hometown: Anderlecht, Belgium

ABV: 5.0 percent

Flavor notes: Rich umami bloom with a buried subtle sweetness; dried cherries in fragrant melted Camembert

Gueuze Tilquin à l’ancienne

Hometown: Bierghes, Belgium

ABV: 6.4 percent

Flavor notes: Fruit first, funk second; a nose of sweet peach rolled in muddy hay, tart and dry as white grape skins

Those bugs are everywhere. But sticklers say that unless the microbes are Belgian, a sour beer is not a lambic. So to brew my first sour, I figured I'd better import the right critters. For that, I turned to White Labs, a San Diego-based company that cultivates and sells yeast. In a move unusual for a microbiology firm, the company also has a tasting room—dozens of beers identical except for the yeast. The idea is to show off the flavors brought by the yeast alone—from WLP530 Abbey Ale to WLP885 Zurich Lager. But with sour beers now such a prize, White Labs has begun culturing Belgian-style bacteria as well. “In Belgium, their cultures are unique,” says Neva Parker, head of the lab. “What we do is try to re-create that.”

I went with White Labs Belgian Sour Mix 1. Parker told me it was a mishmash of Saccharomyces, Lactobacillus, and a wet-hay-scented kind of Brettanomyces bruxellensis common around the famous Cantillon brewery in Brussels.

I steeped cracked grain in a soup pot on my stove, boiling the result with a handful of crushed, pelletized hops—the preservative flowers add some complementary bitterness and keep the beer safe from truly poisonous bacterial infection. Then I chilled this wort on a 5-pound bag of ice in my sink, siphoned it into an empty cider jug, and upended the little vial of grayish slurry from White Labs. After about a day it started bubbling. (God is good!) Then nothing. I waited. A thin film began to slick its surface, sea-monkey-like flecks dove and rose in the hazy brew. I waited. And waited. And then plum forgot about it. After a year in my pantry, all the gunk had settled in a layer of gray-white sediment—dead cells that brewers call trub—and the beer cleared. I ventured a sip.

It was terrible. This was liquid fire—it actually hurt to drink. The sourness didn't blossom in layers of fruit and herbs, didn't ripple into lingering furrows of flavor—it stabbed.

I poured the whole thing down the sink.

What went wrong? I had used the best Belgian bugs and made as close to a Belgian beer as I could. Why had I failed?

And then it hit me: I was using terroir, all right. But it was the wrong terroir.

Brewers can sample the effects of individual yeast strains at White Labs’ tasting room. Benjamin Rasmussen

“How to: Capture Wild Yeast” is one of the most vibrant and—fair warning—time-consuming threads on Home Brew Talk, the online forum for home brewers. There, a gloriously goofy mix of nerds and poets engage in an endless game of one-upmanship: Who can make the most natural, most spontaneous, most authentic sour beer, and who can describe it in the most florid prose. Brewers show off Technicolor petri dishes and bulging yogurt tubs—pellicle porn. When the beers work, out come the similes: banana, honey, eucalyptus, egg, dill, cinnamon, pineapple, mango, pepper, bubblegum. “Feet with a hint of sour milk,” “like a medium-stinky Camembert,” “rhino farts mixed with sour fruit.” And this is bragging.

Each home brewer has his own sour-making methods. The guidance I found there ranged from “if you happen to own a dye-terminator capillary sequencer …” to “squash a pollen-laden honeybee on a plate.” I didn't have a sequencer, let alone a backyard orchard or koelschip.

But, I realized, I did have a million-microbe colony at my disposal. Better still, it was special. I had, on the middle shelf of my fridge, an old Prego jar full of sourdough starter.

Bread is sort of the inverse of beer. Both involve carbon dioxide and ethanol. But beer captures the ethanol while an understated foam rises to the top; bread solidifies the foam while the alcohol bakes off. Sourdough starters, like lambics, are born spontaneously. A wet dough left uncovered will catch wild yeast from the air. Bakers keep the infected dough alive with regular feedings and pass it on, loaf to loaf, baker to baker, generation to generation. As with lambics, folklore reigns. One San Francisco bakery claims its starter dates to the gold rush.

The best sourdoughs command the same sort of cultish reverence as the best sour beers and for years were thought to come only from a few places. San Francisco's loaves are so famous, a Lactobacillus species is named after the city: L. sanfranciscensis, known for molecules like fruity isobutanol, butter-sweet acetoin, and grassy 1-hexanol.

I had a plan. I put another pot of cracked grain on the stove. I crushed in a handful of the same hops and siphoned the cooled-down wort into the same cider jug. But this time, instead of a lab-sealed tube, I pitched in a spoonful of my sourdough starter. Again, I waited.

But I wasn't working blind. I'd sent a sample of my starter to Kelvin Chan at the genome lab SeqMatic, to identify the fungi and bacteria it contained. As I'd expected, Chan found lots of Lactobacillus, mostly sanfranciscensis. Some Saccharomyces. But then the weird stuff emerged. SeqMatic's machine found Pichia, a whole other yeast genus. “It isn't commonly seen, and in this case there was more of it than Saccharomyces,” Chan says. He also found genetic signatures for photosynthetic bacteria that, well, probably came from my sink. “We might just be picking up the chloroplast DNA of the wheat,” he says. “That's the drawback to seeing everything. You see everything, even if it's not living.”

The lab offers nearly 300 strains, including this one with Belgian heritage. Benjamin Rasmussen

Everything. This, I realized, might be where terroir resides. The antiseptic lab-grown culture I'd tried had left out these extras—the scrubby underbrush, the in-between organisms that knit the whole ecosystem together. Those organisms suggest a far more complex microbial ecology than I expected, one based not so much in geography, but in process. B. bruxellensis isn't unique to Brussels—I'd bought mine from a lab in San Diego, after all—but those same microorganisms will make different flavors depending not just on where but on how their stewards maintain their cultures. In the case of the beer I was making, that meant the frequency and duration with which I'd fed (or “refreshed”) my starter, its storage temperature, the type of flour and carbohydrates and nutrients it contained, the kind of water I used (tap? bottled?), even the vigorousness with which I stirred the critters—every variable favors certain bacteria and yeasts over others. The same is true for those tiles over Cantillon's fermentation pools. An ecosystem's worth of conditions, from temperature to humidity to competing fungi and bacteria, influence what exists at life's smallest scale. Every room, every forest, every home brewer's stovetop creates, over and over again, its own microbiome.

Pichia is aerobic—it likes oxygen. Saccharomyces doesn't; perhaps I stir too much. And Pichia prefers warmer temperatures, which might also explain the presence of a touch of vinegary Acetobacter and L. plantarum. Some bakers refresh with distilled water, or bottled—my tap-water-and-flour mixture favors Saccharomyces and its bready flavors over the funky esters of Brettanomyces, which wasn't present at all.

So here is the reality: Terroir is more than just a country or a city. It's a kitchen. My kitchen. My sourdough starter is San Franciscan, but more than that it's mine—refreshed occasionally, whenever I remembered, with half a cup of tap water (or so) and half a cup(ish) of bulk-bin flour, stored in a noisy fridge with a broken icemaker for the last three years.

Sours can take months to fully develop, but I got impatient. After two weeks I popped the air lock off the top of the cider jug with my sourdough beer, found a glass, and poured a frothy half cup. I sniffed first—it was fresh, with a bit of a bakery's sweetness and tang. I took a sip.

OK, it didn't have the bright pop of Allagash's Resurgam. But it was fine beer, stress-free to make and refreshing—bready and light, with the crunchy snap of a good loaf. You might not line up outside my apartment for a taste, but it was definitely a sour worth drinking. I wouldn't sing its funky glory to Home Brew Talk, but that was never quite the point. It tasted great—to me.