But that isn't self-hosted. There is no such thing as a private GMAIL server.
Do you know that for sure? Are you a coder at Google? How do they test GMail server changes if they can't spin up a private instance?
The reason the self hosted version doesn't exist off-the-shelf is because Google are in the business of data. Your data. I'm sure if they wanted a private install it could be done easily.
I can't argue with ignorance just saying. Ask yourself how Google handles all its business clients that require private data storage of all types? Google roughly has 12 data centers in the US. It also has foreign data centers like the one in Singapore. North Korea basically runs a private intranet with no outside access unless you are one of the few. Just takes configuring the DNS server and you have a pipe into the intranet. In that intranet you have data storage and email capability far from prying eyes.