Two other technological advancements that have enabled private houses and apartment buildings to dispense with live porters/doormen:
1.) The telephone--your cell phone especially, but landlines too! Before that, if you needed to get in touch with someone faster than a letter would get there (which might have been pretty fast, depending on time and place--in Sherlock Holmes's day, London had three daily mail deliveries! but that still wasn't instaneous), your only other option was to knock on their door--and if they weren't in, someone needed to be there to take a message.
2.) Electric lighting and heat. The porter would sit up till (and often past) your usual hour to come home, and if you still weren't there, they would leave some kind of light burning and a taper for you to light your way to your room. In multifamily buildings, they'd often have a room right inside the door with a small window opening in it, and leave a lamp burning either just inside or outside that window, where they could reach it without getting up, so that that live flame was never left unattended.
In general, it's hard for modern people to understand how ubiquitous, and how necessary servants were in the past, in almost every social stratum. Managing a household run on fire for light, heat, and cooking simply required so much more work--making fires, tending fires, CLEANING THE GODDAMN SOOT OFF OF EVERY SURFACE EVERY DAY--that almost every family had to outsource some of it.
And even if you lived in one of the cities where most of that work could be outsourced outside your own home, the one indispensable servant you still needed was the porter.
In Paris circa 1830, visitors from abroad would often note, in wonderment, that it was possible to live with no servants but the porter. You could hire a cleaner who didn't live in; you could order dinners from the traiteur, who would send them over hot along with dishes and set the table for you--you could even order dinners on a regular schedule, basically a meal subscription; there were even companies that would deliver a bath to your home, with a portable tub and a cask of hot water, and haul away the dirty water when you were done. (If you were already paying for water delivery--which many people did; most of the city got its water from public fountains rather than private wells--economies of scale for fuel meant it was only very slightly more expensive to use one of these services than to heat water yourself.) But all of these services were made possible by having the porter there to let all these other people in and out, take messages, and keep a light burning.
In small multi-family buildings this role was sometimes played by the landlord, which obscured the service relationship, but often (and almost always in larger buildings) they would be hired by the landlord and their wage folded into the rent; they were also often the onsite handyman, just like a live-in superintendent in some apartments today. They would also often be available to take on other service work for the tenants--cleaning, shopping, errands.
It's also hard, I think, for modern people to grok how much cheaper labor was compared to the price of things--food, clothes, manufactured goods. We are used to thinking of things as basically costing their labor costs, with the price of raw materials a rounding error; before industrialization, that ratio was reversed. You've heard the line attributed to Agatha Christie, about how growing up she never expected to be so rich as to be able to afford a motorcar or so poor as to not be able to afford a servant?
Again, Paris circa 1830: In Les Misèrables, one of the privations we are told Marius endures while working his way up to merely poor from absolutely penurious is "sweeping his own landing." By the time he's living in the Gorbeau House, the filthiest tenement we see in the book, he still doesn't have heat in his room, but he is paying the portress to clean his room and buy the bread and eggs for his breakfasts. He pays her, for these services above doorkeeping, thirty-six francs a year, which is six francs more than his rent. His food costs ten times that--one franc a day, three hundred sixty-five a year, eating very frugally but adequately. (He was also spending one hundred francs a year on his outer clothes, fifty francs on underwear, and fifty on laundry, for an exceedingly inadequate wardrobe which did not really allow him to maintain a respectable appearance.)
(Note that laundry is outsourced; no one in a city at almost any income level did their own laundry. Mrs. Beeton--English and half a century later, but applicable--said that in most middle-class households sending out the laundry and hiring another servant to make it possible to do at home cost about the same, and that of the two, sending it out was by far the easiest; she only recommended trying to do laundry at home for large country estates that had less soot to deal with, more space for drying, a long distance from the nearest town, and a large enough household to make it worthwhile.)
1.) Everyone except the very poorest and people who were servants themselves had servants until very recently. (And the servants did have servants sometimes--in a very large estate, part of the job of the stillroom maid was to wait on the housekeeper, cook, and butler.)
2.) Even the very poorest of the poor still had porters and doorkeepers, if they were renters in a multi-family building, because the building itself could not function without them. The porter or doorkeeper was the single absolutely most essential piece of domestic labor, full stop.
3.) And, what, you think a good doorkeeper is going to let the rich dude open the door himself?