Every Ubuntu computer carries a name that identifies it on the local network, in remote connections and in the terminal prompt. Most machines keep whatever was typed during installation, so changing the hostname to something recognizable makes one computer easy to tell from another.

GNOME labels the hostname Device Name in Settings and passes a new value straight to the system. The new name applies as soon as it is saved and stays after a restart, so there is no need to log out or reboot.

An administrator account can edit the field, while a standard account sees it greyed out and cannot change it. Settings also leaves the old name in the local hosts file, which the command-line method in the related guide updates by hand.

Steps to change computer hostname on Ubuntu (GNOME):

  1. Click the status icons at the top right of the screen to open the system menu.
  2. Click the gear button in the system menu to open Settings.
  3. Select System at the bottom of the sidebar.
  4. Select About.
  5. Replace the name in the Device Name field with the new hostname, such as office-laptop.

    A name with capitals or spaces, such as Office Laptop, stays in the field as typed, while the hostname itself becomes office-laptop.

  6. Click the tick at the end of the Device Name field to save the name.

    Closing Settings before saving discards the new name. Pressing Enter in the field saves it too.

  7. Press Ctrl+Alt+T to open a new Terminal window.

    The tick disappears once the name is saved.

  8. Check that the prompt shows the new hostname after the @ sign.

    A Terminal window that was already open keeps the old name in its prompt until a new one is opened.

Share this guide