sudo hostnamectl set-hostname myserver
Category: Self-Hosting
sudo hostnamectl set-hostname myserver
Set the server's hostname — used in logs, prompts, and service discovery
Changes the server's hostname — what appears in the terminal prompt, log files, and when other services identify this machine.