Feelings of loneliness arise for a variety of reasons, only some of which are physical.
* Crowding increases loneliness.
* Greenspace decreases it.
Crowding forces you to develop a "thick skin." If you are in a crowd you cannot pay attention to the details of the lives of those around you, because it would quickly overwhelm you. So you build defenses against being intimate with people. And those tend to work on everybody.
Greenspace is relaxing. And it spreads people out. And people who are relaxed tend not to be so on guard. So you meet people. Say you take your dog for a walk and meet somebody else walking their dog. Or you go hiking and meet another hiker.
So arranging things such that people don't live in "rabbit warren" apartment blocks with many thousands of people all piled on each other is helpful. And lots of parks and walking paths and other similar things is also.
However, a key quote from that link is this:
In contrast, perceived social inclusivity – the feeling of being with people who share our values and make us feel welcome – was associated with a 21% decrease in loneliness. 207
This suggests that it’s the quality of our social relationships that matter – rather than the amount of social contact we have.
That is, you will feel less lonely if you are in a community of people who share your values. Just a few examples of such communities (there are, of course, many more): - Religious groups - Community and volunteer groups such as The Shriners - Activity groups such as Scouting
So what you want is cultural structure that encourages activities based around common values or common ideas.
The type of group that works will depend on the local culture. For example, there is a group called Four H. The four H's are head, heart, hands, and health. It is primarily a rural-farm sort of thing. They do things like teaching children how to raise farm animals, or do bee keeping, or the basics of forestry. It won't work very well for people who live in typical mostly-pavement cities. But a modified version could certainly be arranged. After all, Beverly Hills California has a Boy Scout troop. 121