“Renting something is almost impossible,” said Fritjof Andersson, 33, over a cup of coffee at the shared office. Mr. Andersson started his first tech company more than a decade ago, but now cannot afford to bring international developers to the Swedish capital to expand his small team.

“We don’t have the financial muscle to help them find an apartment,” he said, adding that he was recently forced to limit a search for new coders to people already living in Stockholm. “If the city wants to attract start-ups, someone needs to fix the housing problem.”

Image In Stockholm, real estate developers are seldomly allowed to build skyscrapers. Credit... Martin Edström for The New York Times

Many people in Stockholm welcome the new workers. But critics say the newly arrived, who often have salaries that dwarf local residents, should not be given priority over people who have lived in neighborhoods for decades.

“Rents going up will only force people to move out of their homes,” said Marie Linder, chairwoman of the Swedish Union of Tenants, which represents the rights of existing renters, many of whom live in low-cost government housing. “People will have to leave their apartments, but where will they go?”

The complaints are echoed in other cities with a heavy concentration of tech companies. In San Francisco, local residents have complained bitterly that 20-something engineers and developers have transformed entire neighborhoods, where upmarket wine bars and expensive yoga studios have replaced down-on-their-luck bookstores and family-run coffee shops.

Yet as the average salary rises in many cities, local planners say the often-rapid gentrification can benefit the majority of a city’s population.