You can easily enable the Private Mode in your community. By enabling this feature, only logged in users can access your community.

Please check out the guideline below, explaining how you can activate the Private Mode with a few click:

How to activate private mode in my Tribe community?