Nelson Mandela spent 27 years in prison. And even then, after the government had decided to let him out, he still tried to get more time (so people outside could have enough time to plan events to mark his release).
The only things you need are the things that keep your mind ticking over. Food, water, shelter, warmth¹ –that’s it. You do not need any one or any other things (allowing others into your life is a choice, not a necessity or desperation).
Because if your mind is sound, you are sound. Everything else –desires create by mental or physical urges or even freedom (as witnessed by Mandela, you can be free anywhere)– is an irrational construct, misguided by bodily urges.
¹ And since we are social creatures, maybe a little human contact. But this is not as essential as the others.