Change your Ubuntu device hostname (graphical and terminal methods)

Quickly rename your Ubuntu computer so it’s easier to identify on the network. This guide shows the two common ways: through the Settings app and with hostnamectl in the Terminal.

What the video covers

Rename a running Ubuntu system’s hostname (device/computer name) using the graphical Settings app or the terminal command hostnamectl.

Watch the video on YouTube

Step-by-step instructions

  1. Use the Settings app
    Open Settings, go to the System/About (or About) page, click the current Device Name or Hostname, type the new name using letters, numbers and hyphens only, then confirm or save the change.
  2. Use the Terminal (quick method)
    Open a Terminal and run: sudo hostnamectl set-hostname your-new-hostname Replace your-new-hostname with the name you want (no spaces).
  3. Reload session or reboot
    Log out and back in, or restart the computer so desktop sessions and services recognize the new name.
  4. Verify the change
    In Terminal run hostnamectl or hostname to check the current hostname. You can also revisit Settings About to confirm the Device Name was updated.

Watch the video

Video thumbnail for Change your Ubuntu device hostname (graphical and terminal methods) Play tutorial

Watch on YouTube

Why it matters

A clear, unique hostname makes it easier to locate the device on local networks, connect via SSH, and manage multiple machines consistently.

Check your result

Confirm the new hostname is active by opening Terminal and running hostnamectl or by checking the Device Name in Settings. You can also run hostname to see the current short name.

Troubleshooting

If services or remote sessions still show the old name after changing it, log out and back in or restart the system so all user sessions and system services pick up the change. If hostnamectl reports an error, ensure you ran the command with sudo and that your user has administrative privileges.