Aoife Brennan’s day begins at 5:40 a.m. in Dundalk, 85 kilometers north of Dublin, with a bus that, if the traffic on the M1 behaves, deposits her at the gate of her university two hours and 10 minutes later. She studies in the library between lectures because going home is not an option, eats a packed lunch because a sandwich in the city costs 7 euros, and is back in Dundalk by 9 p.m. “I have been to one party in two years,” she said. “It was a Thursday. I slept on a friend’s floor and my mother did not sleep at all.”

Ms. Brennan, 19, a second-year business student, is one of a growing number of Irish university students for whom the traditional move to the capital has become unaffordable. A survey released on Tuesday by the Union of Students in Ireland found that 41 percent of students at Dublin’s four universities now live with their parents, up from 27 percent in 2019, and that 18 percent commute more than 90 minutes each way. Universities have begun scheduling fewer 9 a.m. lectures to accommodate them.

The cause is simple arithmetic. Dublin has about 100,000 full-time third-level students and, by the government’s own estimate, a shortfall of 20,000 student beds. Purpose-built student accommodation, much of it developed by international investors since 2016, rents for an average of 1,250 euros a month for a room in a shared flat, close to the median monthly take-home pay of a young worker. A room in a private house, if one can be found, averages 900 euros. The state grant for students from low-income families who live away from home is 6,971 euros a year, about half the cost of a purpose-built room for the academic year.

“We built a student housing market for the children of the global upper middle class and then expressed surprise that Irish students could not afford it,” said Dr. Siobhán Walsh, a housing economist at University College Dublin. Much of the purpose-built stock, she noted, is marketed to international students, who pay fees of 20,000 euros a year or more and whose numbers have grown by 60 percent in a decade. “The commute is the invisible cost. It does not show up in the rent statistics. It shows up in dropout rates and in who gets to do the unpaid internship.”

The government announced in July a plan to fund 4,500 beds built by the universities themselves, at rents capped at 600 euros, with the first due to open in 2028. Ciarán Doyle, the president of the students’ union, called it “the right policy, a decade late and a quarter of the size.” The union is campaigning for a rent cap on all purpose-built student housing and for the state grant to be raised to reflect Dublin rents rather than national averages.

Universities say the commuting shift is changing campus life in ways they are only beginning to measure. A university in the south of the city reported that membership of sports clubs and societies had fallen by a third since 2019, and that library use peaked at hours that tracked bus timetables.

Ms. Brennan said she would consider a transfer to a university in Belfast or Galway if a room came with it. “I chose Dublin because it was the best course,” she said. “Nobody mentioned that the course was the easy part.”