Make Pi-hole worked anytime on ubuntu when i turn it off

It stays on as long as you let it stay on. Any linux computer (which includes the Raspbery Pis) will work as long as it runs a supported distribution: