This is not typically needed, as nowadays we just tend to use GitHub or other management service.
You can create a “bare” repository to function as a git server. The down-side is that you can't work directly in the bare repo. This allows others to push changes to it without creating issues with a checked-out branch in the server. You can clone it somewhere else and work in that clone.
Create the Repository:
Clone, pull,commit,push as normal: