I find that even working from home is too distracting, and I live alone.
My most productive programming hours are 11pm to 8am. I'll pull an all-nighter maybe once or twice a month and I get a stupendous amount of work done. That's the only time I feel a sense of complete solitude and focus. No Slack messages, no phone notifications, no noise from my neighbors, not a single disruption whatsoever for hours on end. And knowing I have a horizon that stretches on for so many hours somehow allows me to relax and tackle the most difficult tasks.