@ivanildolb a domain can be had for very cheap, most registrars have sales so you could get somedomain.tld for like 88 cents for a year sometimes.. or 2$ etc.. that normally will go up after year 1, etc. but typically a domain only costs like 10$ a year.
But yeah it is just not possible for some browser to auto trust some cert without it being public domain.. You can use any domain you want and create certs your browser will trust - but you have to have enough control over the browser to install the CA cert as trusted source..
I do this for all my services I run locally that I access, the unifi controller web gui, my nas gui, pfsense gui, my printers gui, my switches web gui... For these I use either local.lan as the domain, or home.arpa - you can use any domain you want and your browser will trust it, as long as you tell the browser to trust the CA.. But if its just some random browser out of the box on someones machine - no they will not trust anything other than some public CA, and for this you have to have a public domain.