I like the Zen saying “Can you be a hermit in the crowd?” but, of course, the sentiment is not exclusive to Zen. Here is a version attributed to Amma Syncretica, one of the women desert hermits (Desert Mothers) of early Christianity:
Many who live in the mountains behave as if they were in the city; they are wasting their time. It is possible to be a solitary in one’s mind while living amidst a crowd as it is possible for one who is a solitary to live in the crowd of his own thoughts.