If the server has no internet access:
The Software Licensing Management Tool ( slmgr ) is the most reliable method for remote server administration, Server Core installations, or automation scripts. KMS client activation and product keys - Microsoft Learn