ubuntu logo

Ubuntu 20.04 Server: How to permanently rename an Ubuntu 20.04 Server.

Spread the love

To permanently change an Ubuntu 20.04 Server’s name edit the /etc/hostname file:

sudo vim /etc/hostname

This will show the current server (host) name:

Ubuntu 20.04 Server: How to permanently rename an Ubuntu 20.04 Server.
Ubuntu 20.04 Server: How to permanently rename an Ubuntu 20.04 Server. 1

Rename Ubuntu 20.04 Server:

Change the name to whatever you want to call the server:

Ubuntu 20.04 Server: How to permanently rename an Ubuntu 20.04 Server.
Ubuntu 20.04 Server: How to permanently rename an Ubuntu 20.04 Server. 2

Save the changes (esc :wq in vim).

You will see that the host still has its old name:

Ubuntu 20.04 Server: How to permanently rename an Ubuntu 20.04 Server.
Ubuntu 20.04 Server: How to permanently rename an Ubuntu 20.04 Server. 3

Reboot the server to update its name to the new name.

Now the server has its new name:

Ubuntu 20.04 Server: How to permanently rename an Ubuntu 20.04 Server.
Ubuntu 20.04 Server: How to permanently rename an Ubuntu 20.04 Server. 4

This change is now permanent.

For more Ubuntu articles as how too’s click on our Ubuntu Category.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top