How to Change Your Hostname (Computer Name) on Ubuntu Linux

Ubuntu asks you to choose a name for your computer — known as a “hostname” — when you install it. You can change this hostname later, but Ubuntu doesn’t provide a graphical interface for doing so.

The process here will also work on Linux Mint and other Debian-based Linux distributions. Other Linux distributions — for example, Fedora and other Red Hat-based distributions — use different methods for specifying a hostname.