Hosting a Git repository can be a strong need if you want to keep your projects outside the cloud providers.
Keep in mind security offered by GitHub, GitLab and Cloud providers like AWS, MS-Azure, etc are damn good (often offering 2FA, two factor authentication, for free) , so think twice before deciding to hosting your own git server.
It is a good shot if you do not plan to expose it to Internet, otherwise the expertise required to secure it, it is not trivial.
For big need, GitLab Community edition is a winner because offer an easy to install solution with CI-CD pipelines, and a huge set of feature.
We use it internally at NTT Data, but it is also a solution adopted by some customers.
Anyway GitLab uses a lot fo resources.
For more minimalisti needs, look at Gitea, which is compact, offers issue tracking, search functionality, pull requests and uses as little as less than 300MB of RAM for running.
Also GitBlit offers similar functionality in java-land, with slow-paced release cycle and some enterprise feature out of the box.