I have the option of working from the office or from home, at least 2-3 days per week depending on what I have on. I much prefer working from the office. I enjoy hanging out and talking shit (and working) with my colleagues/friends, grabbing coffee, lunch somewhere nice, and when I leave at the end of the day I can flip from 'work mode' to 'home mode'.
This is by far the most important decision criterion: the psychological cost.
If I didn't enjoy the company of my co-workers I'd probably just find a new job.
1. Create co-working opportunities. I have a standing co-working day with a group of other work-from-home'ers every Monday. Sunday afternoon we text to coordinate where we're going to meet up. Its reliable. Its social interaction. We have an in-group. On top of this one, I have a couple other people I less frequently co-work with, both coffee shops and kitchens.
2. Its not all about work. This WFH shift for me has given me an even stronger excuse to get out and do my group hobbies even more. For me, its performing in a comedy group. Nothing more social than getting people to laugh.
3. Yes, it is a bit lonely. Happy hours are less likely to happen. But when they do, its with people you actually wanted to hang out with, not just whomever happened to be at the office that day. Casual desk drop-by's are mostly gone, and I actually like that.
All in all, not that lonely, unless you let it be.
I just joined a local group and they do lunch meetups, happy hours, etc.