GitHub is not Git! The latter is just an engine, but GitHub goes far beyond that.
It is very disappointing to see so many posts in this thread, touting Git as an alternative.
GitHub is just a Git hosting service. What are you doing when working with GitHub? You're actually working with Git, and pushing to GitHub.
That's what makes the last quoted sentence sound a little hilarious..

You can use any other hosting service, such as one you run yourself.
Christ, why do they make it so complicated? In the case of Gitea (which is still using actual Git), you just have to make a Git working dir, copy the binaries to /bin and copy the supplied systemd service to the respective systemd folder. There's even a Docker container to avoid all this hassle.
It's actually not really complicated at all; most of the steps are general Git usage information.
As far as I know, if you want the GitHub web frontend: that's closed-source, last I checked. But GitLab and indeed Gitea, are open source and can be hosted anywhere.