Long before it became the largest independent literary festival this side of the country, Litquake began as a low-key cluster of writers gathering on a foggy, windswept July day in San Francisco in 1999.

“It was 22 authors over four hours in Golden Gate Park, just doing readings one after the other,” says co-founder Jane Ganahl.

The idea was casually hatched by Ganahl and Jack Boulware, who were both journalists at the time, over beers at the local Edinburgh Castle Pub. The intention was simply to organize a centralized meeting for the circle of writers they knew. Some 400 people ended up showing up to listen on a Friday afternoon.

“We kind of looked at each other and went, I think we got something here,” Ganahl recalls. There was no long-term future in mind, but that first gathering, then dubbed “Litstock,” was the start of a two-decade journey that has come to be a central force in maintaining and cultivating San Francisco’s tradition as a literary city.

Litquake, now a nonprofit that also hosts year-round literary events, will host its 20th festival from Thursday, Oct. 10, through Oct. 19, featuring more than 200 readings, panels and various events with more than 860 writers, including, as it does each year, legendary authors like Tobias Wolff and Ann Patchett and rising novelists like Tommy Orange and Ingrid Rojas Contreras.

It will, of course, include its famous Litcrawl, a massive one-night pop-up event throughout the Mission that will showcase some 500 writers of all shades reading their works in pubs, cafes, barbershops and every space imaginable. The trademark festival event has spawned iterations across the country and globe.

The literary takeover is now an annual San Francisco tradition, but in 1999, the city’s writer scene was strikingly different.

“It wasn’t anything like it is now,” Boulware says. “There’s tons of literary events all over the Bay Area every night of the week. There wasn’t a place where, if you were a writer, you could go somewhere and think, ‘Oh my God, I’m not alone.’ ”

And yet, the Bay Area at the time was also a hotbed of writing talent. Amy Tan was a global literary star, and the San Francisco Writers Grotto, the city’s famed group populated by celebrated authors, had formed earlier in the decade. In their conception of Litquake — centered solely on a mike and on writers’ work — Ganahl and Boulware unwittingly tapped into something that was not only vital for the community, but that also felt like a new and radically pure concept for any literary scene.

“What I loved about Litquake was, no matter where you were in your writing career, there were opportunities to be a participant in that festival,” says Natalie Baszile, the San Francisco-based author of “Queen Sugar” (now an acclaimed television show).

In Los Angeles, where Baszile is from, she said struggling writers were mostly observers, rarely part of the presentations. The same went for other gatherings and short-lived book festivals at the time in San Francisco, where, Boulware says, these events felt more like trade shows for the publishing industry. Litquake instead offered a place where everybody had a platform.

“As a writer, so often your work is only real to you,” says Baszile, who is also a board member for the nonprofit. “And it is tremendously helpful to connect with other people who are engaged in a similar struggle, and Litquake kind of provided that. Litquake was like a binding element when I moved to San Francisco.”

Its on-the-ground writer-centric focus has remained and translated to the festival’s organic expansion.

“The San Francisco literary community understood what we were doing right away, and they instinctively came to us and helped us in a lot of ways to grow the festival,” Boulware says. People proposed events and brought in authors, and bookstores and venues readily offered their spaces. For a generation of San Francisco writers, the setup provided not only exposure but also a paradigm for a new kind of literary culture in the city.

“Seeing Litquake start energized a lot of people into starting their own event,” says author Beth Lisick, whose Litquake reading in 2002 secured her a literary agent who was in the crowd and led to her best-seller “Everybody Into the Pool.” Lisick references her own live event series, the Porchlight Storytelling Series, along with Charlie Anders’ Writers with Drinks series and Michelle Tea’s Radar Reading Series, all of which sprouted in the years after Litquake began.

Ganahl and Boulware, though, avoid taking direct credit for any outsize influence, which is perhaps the key to Litquake’s success. “One of the reasons we’ve lasted for 20 years is that we never intended to become big,” Ganahl says. “One place that we have held the line, is that we have never taken money from a large chain, like Amazon or even Barnes & Noble, because we know that our bread and butter is independent bookstores.”

Most of its programming each year is also free to the public. The festival, in turn, has faced its fair share of challenges. After the dot-com crash and a mass exodus by creatives out of San Francisco, the young festival shut down in 2001, before returning the next year (and swapping out the Litstock name). Ganahl and Boulware had to learn on the fly how to run a nonprofit, and the festival’s programming is constantly adapting.

Yet, even amid drastic undulations in both the book world and in the city itself, the festival has survived and thrived behind a supportive community. Each year, its audiences are steady and spread evenly across age groups, and amid demographic changes in the city, young tech workers are showing up in droves.

“I feel like we are sort of a touchstone for many, many people in the Bay Area who feel like it’s not the same here anymore,” Ganahl says. “People have said that the city has lost its soul, and I feel like Litquake is one of the things that keeps the soul alive.”

Lisick, who was one of the authors at the very first gathering, heaps credit onto Ganahl and Boulware. “Jack and Jane still have that wild energy,” she says. But for their part, in considering the upcoming milestone, the founders instead separately offer sentimental reflections on our collective, primal need for inspiration and for storytelling. It’s evident in their favorite memories over the last 20 years: a random short story reading in a barbershop one year that moved Ganahl to tears, or Tom Waits electrifying a crowd with his performance at a Lawrence Ferlinghetti tribute another year.

Boulware remembers disaster striking at a bar during a Litcrawl years ago, when a difficult venue led to the gathering improvising outside. An author stood on a chair, reading on the sidewalk, “in front of this janitorial supply store on Mission Street,” Boulware says. “A crowd gathered around, everybody’s holding pints of beer. Cars are beeping their horns as they go past. It was amazing. It was pure and raw.”

Litquake Festival: Book readings and author events. Thursday, Oct. 10, through Oct. 19. Various venues. www.litquake.org