As rents and mortgages skyrocket across the Bay Area, school districts are increasingly looking to become home builders and landlords to ensure that at least some of their teachers and staff can find somewhere affordable to live.

But creating subsidized teacher housing can be politically contentious, at times prompting backlash from potential neighbors and complaints from labor leaders looking for higher salaries rather than lower rents. And such efforts often fill a fraction of the need.

Projects now being proposed in San Francisco, Oakland and other cities push far beyond the traditional role of public education, from the ABCs into apartment management, loan financing and complaints about noisy neighbors. But that’s not deterring city and school officials, who say they can’t attract and keep teachers, given the high cost of housing.

A handful of K-12 and community college districts have already jumped into the housing business, with the result suggesting that the demand for below-market workforce housing far exceeds the still limited supply.

“It might not be our core competency, but we have a real problem right now attracting teachers,” said Oakland school board member Jody London, who is supporting a proposal to build district housing in partnership with the city near Lake Merritt. “We have to think more creatively about this.”

San Francisco, home of some of the highest home prices and rents in the country, might also get in the housing business. School district and city officials, including Mayor Ed Lee, announced plans last week to build 100 or so affordable apartments for teachers and school staff on one of the district’s 11 surplus property sites.

The city is watching earlier moves by Los Angeles, Santa Clara and the San Mateo Community College District.

Ten years ago, the community college district opened the first of 104 apartments for employees at Cañada College in Redwood City and College of San Mateo, who pay from $875 for a one-bedroom to $1,700 for three bedrooms. Applicants, who must not own another home, can stay for seven years and then, if desired, apply for a $50,000 low-cost home loan. More units are in process for Skyline College in San Bruno.

Best way to retain teachers?

Tax-free financing has paid for the construction and rents are paying off the bank loans, said Barbara Christensen, the district’s director of community and government relations. And workers are sticking around, she said.

“It’s not complicated, it really isn’t,” she said of running housing complexes. “It’s paperwork.”

The same can’t be said for Oakland’s effort. District officials are in the early stages of pursuing workforce housing, but are looking to partner with the city, which owns the desired land at East 12th Street and Second Avenue.

While the district is still preparing a proposal, the teachers union has voiced opposition, saying in a letter to officials that “the development of workforce housing is not the best investment the district can make to retain OUSD teachers.” Teachers salaries in the district are among the lowest in the Bay Area.

The project would require buy-in from neighbors, education groups and the city to develop the publicly owned land.

In Santa Clara, the school district started thinking about such a project in the early 2000s, in the relatively early days of the tech boom. It was already getting too pricey for teachers to live in the South Bay. Partnering with a developer, the first 30 units of Casa del Maestro — House of the Teacher — opened in 2005, with another 40 opening in 2009.

Demand exceeds supply

While the apartments are a perk, the district doesn’t advertise them and they’re not a significant selling point for teacher recruits. That’s because vacancies are rare, said Jennifer Dericco, a district spokeswoman.

“We do not have a problem filling those apartments at all,” she said, adding that the waiting list is only getting longer with Bay Area housing prices rising faster than wages.

Teachers whose households bring in $136,000 or less pay up to $1,805 in monthly rent, can stay up to seven years, and can then take advantage of the district’s low-cost mortgage program to buy their own place.

“It’s great for some recruiting, but even more than that, retention,” Dericco said. “The hope is that the teachers that live in those apartments would be able to save some money and couple it with our mortgage assistance program.”

Some teachers don’t qualify

Los Angeles Unified is more of a newcomer in the government housing game, opening the first of three workforce apartment complexes this year, featuring a fitness room, community room and garden, and monthly rent from $425 to $1,222.

Yet few teachers qualify. The district set strict annual income requirements for residents, which max out at $49,000 a year for a family of four. That means many teacher aides, custodians and office workers qualify.

San Francisco is eyeing a similar idea, building worker apartments for a range of family incomes. Teachers, however, are definitely on the list of desired residents.

In recent years, district leaders have watched helplessly as K-8 educators leave their jobs — some quitting in the middle of the school year when their rent jumped or they got an eviction notice, said Matthew Hardy, spokesman for United Educators of San Francisco, the teachers union.

“We’ve been at the table with the mayor’s Office of Housing and SFUSD for about 18 months now and talking about all the pressures facing educators in terms of the affordability crisis,” Hardy said.

Complicating the issue, San Francisco teachers make too much money — up to $85,000 a year — to qualify for affordable housing, which requires people to make about 50 percent of the area median income, or roughly $50,000 for a family of four.

High-rent anxiety

The starting teacher salary is just over $50,000, but the average rent in the city — $3,000 for a one-bedroom — would eat up most of those earnings.

Among potential candidates for teacher housing is first grade instructor Maribel Chávez, 31, who sublets a bedroom in the Lower Haight for $875 a month. She’s moved eight times in the seven years she’s lived in San Francisco.

“My dream has always been to be here and teach here,” said Chávez, who bikes to her job at Buena Vista Horace Mann School, a K-8 campus. She doesn’t know what she’d do if she lost her current housing, saying, “Just thinking about it makes me feel anxious.”

Would low-rent housing in an apartment full of teachers appeal to her? She doesn’t have to think about the answer.

“I would be here another five to 10 years, definitely,” she said. “That would make it so much easier.”

S.F. housing bond

The San Francisco plan, which is in an early stage, calls for 100 units of housing for teachers and paraprofessionals. It’s not yet clear where a complex would be built, or who would qualify, and the proposal depends heavily on voters passing a $310 million housing bond next month.

With San Francisco employing 6,000 teachers and teacher aides, the plan wouldn’t make a major dent. But it also calls for $40 million for down-payment assistance loans — $20,000 each — to help teachers buy homes, plus $4 million in incentives for about 200 teachers willing to stick around for at least 10 years.

In addition, the city will pay for a housing counselor dedicated to helping district workers navigate through evictions, rent hikes and other woes, said Myong Leigh, the district’s deputy superintendent.

“With those four strategies, we’re hoping to reach a meaningful number of employees,” he said. “We want to do what we can.”

NIMBY opposition

San Francisco considered building workforce housing in the past, but those efforts eventually fizzled, lacking funding and political will. The district would have to overcome any not-in-my-backyard opposition to development of apartments on properties that are now vacant or were former school sites.

The city’s teachers union, however, is behind the effort. And, in contrast to earlier tries, there is a more optimism, propelled by desperation.

“The biggest difference is the affordability challenges and crisis,” Leigh said. “That’s always been an issue, but I don’t think it’s ever been so front and center.”

Jill Tucker is a San Francisco Chronicle staff writer. E-mail: jtucker@sfchronicle.com

Twitter: @jilltucker