All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
If the situation is as you mentioned in the question that the mosque is that far from your residence, then you are not obliged to perform the congregational prayer in that mosque. If there is no nearer mosque to you, it is permissible for you to perform the prayer at home with your family (leading them in prayer).
For more benefit on when it is an obligation to perform the prayer in the mosque, please refer to Fatwa 89364, and to Fatwa 83739.