The demise of Ghost Town Gallery was swift and orderly when two Alameda County sheriff’s deputies marched through the 4,000-square-foot art hub in Oakland earlier this week to give tenants the boot.

What they found in the former dairy factory on San Pablo Avenue was chaos. Floors were sticky with spilled beer and piled high with trash: broken bottles, cigarette butts, chewed-up wires and battered video game consoles.

To landlord Mehrdad Dokhanchy, those conditions were ample justification for the eviction lawsuit he won in May against his tenant, Damon Gallagher, who for years had leased the upper floor of the two-story industrial building. Dokhanchy claims that Gallagher built illegal units, ran an unpermitted bar, and created a frat party atmosphere in what was supposed to be a tranquil live-work space.

But to several tenants who staggered out the door that day, the eviction was a sign of upheaval in an area once known as a bohemian frontier. Oakland’s warehouse scene, which bloomed shortly after the dot-com boom of the ’90s in San Francisco, now appears to be hanging on by threads.

“Oakland’s finished, they’re kicking everybody out,” said Gallagher, who subleased Ghost Town to a variety of eccentrics, from jazz pianists to painters to BDSM fetishists. “I can think of 20 people right now who are either moving, homeless or scraping to find a couch, and these are people who’ve been here more than a decade.”

Ghost Town Gallery is one of several artists’ hubs that have run into trouble.

Residents of another West Oakland institution — the LoBot Gallery on Campbell Street — have been told to vacate their 9,500-square-foot warehouse by the end of July. Monthly rent for the space doubled over the past two years, from $5,000 to $10,000, according to the building’s co-owner Katherine Harmon.

And, in January, city officials cleared dozens of artists from a red-tagged industrial building at 1919 Market St. A 27-year-old tech entrepreneur has promised to turn the building into dorm-style housing for Millennials.

Climate becoming uncertain

“There’s only a few DIY spaces left,” said Adam Hatch, a co-founder of LoBot and former Ghost Town Gallery resident. “The fabric of the artistic community, especially the younger, more impoverished, not-trust-fund artists, are getting run out of town.”

The current climate of uncertainty marks a sharp departure from the optimism of 2003, the year that Dokhanchy opened his live-work lofts in what was the W.C. Creamery on San Pablo Avenue. Former City Councilwoman Nancy Nadel and then-Mayor Jerry Brown attended the ribbon-cutting, Dokhanchy said, hailing the revived industrial building — later renamed Ghost Town Gallery by its inhabitants — as a beacon of the city’s nascent downtown arts district.

City officials at that time were proud that priced-out artists were fleeing from San Francisco to Oakland, even though Oakland hadn’t created much of an infrastructure to accommodate them.

“It was the Wild West, literally,” said Jon Sarriugarte, a blacksmith who opened his own studio in West Oakland’s “Ghost Town” neighborhood in the late 1990s. “There was no code enforcement, and the city didn’t tell you what to do — for good or for bad.”

During that period, there were numerous spaces for artists to rent or buy in the city’s sprawling hinterland. Many property owners didn’t have much faith in the local real estate market and were willing to sell their buildings for low prices, Sarriugarte said. It wasn’t until recently that the market picked up and a few shrewd developers began buying up parcels.

Oakland’s warehouse scene flourished for at least a decade, paving the way for First Friday art walks and a cluster of storefront galleries downtown, as well as a thriving “maker” subculture on the city’s west side.

“When we had our first opening, it was like a U.N. conference of flavors of people,” said Devin Satterfield, who in 2001 co-founded a previous iteration of the 1919 Market St. warehouse called Liminal art gallery. Back then the rent hovered around $4,000 a month for the sprawling, 7,000-square-foot space — cheap enough that Satterfield could pay his share with earnings from a part-time barista job.

“We had graffiti shows, a hobo cabaret, (indie) bands like Deerhoof and Xiu Xiu, a show where we put wood chips all over the floor,” he recalls. “We had this water show where Adam Hatch built a giant pool (under) a kinetic sculpture of a dragonfly.”

Now that scene appears to be fraying.

Area ‘flipping rapidly’

“The neighborhood around us is flipping really rapidly, so of course this is happening,” said LoBot resident Zeph Fishlyn, who is considering “vehicle living” after the gallery closes in July.

Harmon, who co-owns the building that houses LoBot, said she and her business partner had asked the tenants to leave so they could make improvements to the property. She declined to say whether they planned to sell it.

Rachel Flynn, the city’s director of planning and building, said that while she hasn’t noticed a “mass exodus” from West Oakland, she’s aware that competition for warehouse space has ramped up.

“It’s a valuable location,” Flynn said. “What’s surprising to me is that this didn’t happen sooner.”

After a long period of neglect, West Oakland has become a hotbed for new commercial projects. Developers are swooping in to turn old dilapidated warehouses into tech offices or “maker” space, and the price of industrial land has shot up — from 45 cents a square foot in the mid-1980s, to $2.50 a square foot today, according to developer John Protopappas.

“The fact that West Oakland is geographically in the center of the Bay Area has a lot to do with it,” Protopappas said. And the city has become vigilant about code enforcement, he added.

Still, it’s not easy for Sarriugarte to sympathize with his peers who don’t play by the rules.

“I want everyone to stop whining about themselves and take some responsibility for keeping Oakland how it is,” he added. “It’s not common sense to tear down walls (in your building), throw parties every weekend and tag all over the neighborhood.”

Mayor’s efforts

Oakland Mayor Libby Schaaf, who often touts the city’s economic boom, has also established herself as a protector of the warehouse community. She has even intervened in disputes between artists and landlords.

“I’m committed to doing everything I can with (my) government power to preserve the artistic community and the creative spaces in Oakland,” Schaaf told The Chronicle.

Last year she convened a housing task force of volunteers and industry experts — including about 30 artists who pitched ideas for new zoning regulations and affordable housing programs to help safeguard the city’s creative class.

“I think the city government now is finally putting its foot down about development in certain areas,” Sarriugarte said. “There’s more recognition that there’s a limited amount of warehouse space, and it needs to be preserved.”

He said he has hope for the future.

“I don’t think Oakland will be San Francisco — ever,” he said.

Rachel Swan is a San Francisco Chronicle staff writer. Email: rswan@sfchronicle.com Twitter: rachelswan