don't even need that much... just SSH + Files.
On server:
mkdir -p ~/repos/foo.git
cd ~/repos/foo.git
git --bare init
On desktop: git remote add backup ssh://user@server/~/repos/foo.git
git push --all backup
Or something similar, been a while. Can use an absolute path too if sharing, need that path setup for +rwx for user/group. Used to do this as a quick and dirty remote for git usage. You can also setup a git user and add your public key, but find that isn't really necessary.edit: looked up commands, made a couple minor tweaks.
note: this doesn't include any kind of LFS support if you're needing it, consider a more complete install, unsure on gitea or gitlab etc.
You can also use gitea, which is setup very quickly as uses almost no resources
That being said, I am, and probably will still be a massive GitHub user, because I value its community aspect. But I also now have unlimited, truly-private Git hosting for peanuts (cheap DigitalOcean server), which is always nice.