This tutorial shows the installation of an Ubuntu 24.04 LTS server in detail with many screenshots. The guide’s purpose is to show the installation of Ubuntu 24.04 LTS that can be used as the basis for our other Ubuntu tutorials here at howtoforge, like our perfect server guides. This tutorial uses the LTS branch, which gets updates for five years from Ubuntu and is recommended for use on servers.

1. Requirements

To install an Ubuntu Server, you will need the following prerequisites:

2. Preliminary Note

In this tutorial, I use the hostname server1.example.com with IP addresses 192.168.0.100 and gateway 192.168.0.1. These settings might differ for you, so you have to replace them where appropriate.

3. Installing the Ubuntu 24.04 Base System

Insert the Ubuntu install CD / DVD / USB stick into your system and boot from it. When you install the OS in a virtual machine like I will do it here, then you should be able to select the downloaded ISO file as a source for the CD/DVD drive in VMWare and Virtualbox without burning it on CD first. Start the server or virtual machine, it will boot the system and start the installer.

<img alt="Grub Installer" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-5.png66534c6c0e5cb.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="400" loading="lazy" src="data:image/svg xml,” width=”720″>

<img alt="System startup" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-6.png66534c6c26d97.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="400" loading="lazy" src="data:image/svg xml,” width=”720″>

The first screen of the Ubuntu installer will show the language selector. Please select your language for the installation process:

<img alt="Choose installation language" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-7.png66534c6c4f56e.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

On the next screen, you can choose the keyboard layout. The English keyboard will be fine for many users. In this case, choose “Done” at the end of the screen and press the “Return” key, to go to the next step. In my case, I’m using a German keyboard layout, this means I’ll have to navigate to the “Layout” option by pressing the “Tab” key on my keyboard until the Layout option is highlighted. Then press the “Return” key to open the Layout selector. 

<img alt="Choose keyboard" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-8.png66534c6c78cee.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

Choose the keyboard layout that matches the keyboard attached to the server.

<img alt="Switch keyboard language" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-9.png66534c6c9ced0.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

The right keyboard layout for my installation is selected now. Choose “Done” at the end of the screen and press “Return” to go to the next step.

<img alt="New keyboard language selected" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-10.png66534c6cb88a8.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

In the next step, the installer allows you to choose between a standard Ubuntu server setup or a minimal setup. I will select a minimal setup here and install only software that I need at a later stage. This is especially useful when running Ubuntu on a small virtual server.

<img alt="Minimal server installation" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-11.png66534c6ce2857.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

The Ubuntu installer now shows which network card it has detected on the server. The network device name that was assigned automatically is ens33. The IPv4 address has been assigned automatically via DHCP. I will change it later to a fixed IP address when the base system has been installed. If your network has no DHCP server, you can enter a fixed IP address now by choosing the network card (press Tab until it is highlighted and then press Return).

<img alt="Network config" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-13.png66534c6d1f57b.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

Now you can set a proxy server address in case a proxy is required to access the internet. In my case, there is no proxy required, so I choose “Done” to go to the next installation step.

<img alt="Proxy configuration" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-14.png66534c6d3d378.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

Here, you can choose from which Ubuntu mirror server updates and installation files shall be downloaded. I’ll keep the default and go to the next install screen.

<img alt="Mirror server" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-15.png66534c6d6f357.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

The Ubuntu server installer now shows the hard disk detected in the server. The installation disk is a 40GB HD on /dev/sda. I’ll choose to use the entire disk for my Ubuntu installation. If you need a custom layout with multiple partitions, select “Custom Layout” instead and create partitions as required.

<img alt="Disk partitioning" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-16.png66534c6d9b6b8.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

The installer shows the default storage configuration below. It consists of a 2GB /boot partition plus one large / partition containing the operating system installation. But as we can see, Ubuntu left 19GB unused in the LVM partition. In the following steps, I will reconfigure the LVM partition to use all space for the / partition. Alternatively, you can use the unused space e.g. for a /home or /var partition, depending on how you plan to use the system.

<img alt="Ubuntu partition layout with LVM" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-17.png66534c6dcb5a2.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

Go to the / partition (ubuntu-lv) in section ‘used devices’ as shown below.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-31.png66534c6e00e15.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

Choose to edit partition.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-32.png66534c6e37865.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

Enter the max size into the size field.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-33.png66534c6e754cc.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

Press save, and now we have 100% of the space allocated to the / partition, as shown in the screenshot below.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-34.png66534c6e97e3c.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

Before the installation starts, the Ubuntu installer requests to confirm the partitioning. Press the “Tab” key until the “Continue” option is highlighted in red, then press “Return” to proceed.

<img alt="Write layout changes to the harddisk" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-18.png66534c6eb5af5.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

Now it’s time to set the server name (hostname) and the administrator’s username and password. I’ll choose the username ‘administrator’ here as an example. Please use a different and more secure name in your actual setup. The Ubuntu shell user we create in this step has sudo permissions, meaning he can administrate the system and become a root user via sudo.

<img alt="Create a user" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-19.png66534c6ed2ba7.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

Ubuntu now offers the option to buy Ubuntu pro. I will use the OpenSource version here and skip that step.

<img alt="Skip Ubuntu pro" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-20.png66534c6f00ba6.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

Most Linux servers get administered over the network using SSH. In this step, the Ubuntu installer can install the SSH server directly. Select the checkbox “Install OpenSSH Server” and proceed to the next step.

<img alt="Install SSH server" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-21.png66534c6f27471.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

In this step, you can preinstall commonly used services via Snap installer. I do not select any services here as the purpose of this guide is to install a minimal base system. You can install services via apt or snap at any time later.

<img alt="Preselect packages" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-22.png66534c6f50698.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

The Ubuntu installer now proceeds with the installation based on our chosen settings.

<img alt="Installing packages" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-23.png66534c6f70ec0.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

Ubuntu Installation finished successfully. Select “Reboot” to boot the server into the fresh installed Ubuntu 24.04 system.

<img alt="Ubuntu 24.04 installation is finished" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-24.png66534c6f9be57.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

The base installation is finished now. In the next chapter, I will explain the configuration of the static network address and install a shell-based text editor for editing configuration files.

<img alt="Booting Ubuntu 24.04" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-25.png66534c6fd3ff9.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="400" loading="lazy" src="data:image/svg xml,” width=”720″>

4. First Login

Now login on the shell (or remotely by SSH) on the server as user “administrator”. The username may differ if you have chosen a different name during setup.

<img alt="Ubuntu 24.04 Login prompt" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-26.png66534c70050b4.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

Successfully Logged into Ubuntu 24.04 Server.

<img alt="Successfully installed Ubuntu 24.04" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/ubuntu-24-04-minimal-27.png66534c7037f3a.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="468" loading="lazy" src="data:image/svg xml,” width=”750″>

5. Get root Privileges

After the reboot, you can log in with your previously created username (e.g. administrator). Because we must run all the steps from this tutorial with root privileges, we can either prepend all commands in this tutorial with the string sudo or we become root right now by typing:

sudo -s

You can enable the root login by running:

sudo passwd root

And you are giving root a password. You can then directly log in as root, but this is frowned upon by the Ubuntu developers and community for various reasons. See https://help.ubuntu.com/community/RootSudo.)

6. Install the SSH Server (Optional)

If you did not select to install the OpenSSH server during the system installation above, you can do it now:

sudo apt -y install ssh openssh-server

From now on, you can use an SSH client such as PuTTY and connect from your workstation to your Ubuntu 24.04 server.

7. Install a shell-based editor (Optional)

Here, we will install two text-based editors. The Nano editor is more straightforward for newbies, while others prefer the traditional vi/vim editor. The default vi program has some strange behavior on Ubuntu and Debian; to fix this, we install vim-nox:

sudo apt -y install nano vim-nox

8. Configure the Network

Some commonly used network tools are not installed when choosing minimal installation. We can install them with the following command:

sudo apt install net-tools

Because the Ubuntu installer has configured our system to get its network settings via DHCP, we can change that now because a server should have a static IP address. If you want to keep the DHCP-based network configuration, skip this chapter. In Ubuntu 24.04, the network is configured with Netplan by cloud-init, and the configuration file that cloud-init uses to configure netplan is /etc/netplan/50-cloud-init.yaml. The traditional network configuration file /etc/network/interfaces is not used anymore. Edit /etc/netplan/50-cloud-init.yaml and adjust it to your needs (in this example setup, I will use the IP address 192.168.0.100 and the DNS servers 8.8.4.4, 8.8.8.8 .

The first step is to disable network configuration via cloud-init as we configure the network settings with netplan directly. Run the following command to do so:

echo "network: {config: disabled}" > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

Then open the network configuration file with nano:

sudo nano /etc/netplan/50-cloud-init.yaml

The server is using DHCP right after the installation; the interfaces file will look like this:

# This file is generated from information provided by the datasource.  Changes

# to it will not persist across an instance reboot.  To disable cloud-init's

# network configuration capabilities, write a file

# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:

# network: {config: disabled}

network:

    ethernets:

        ens33:

            dhcp4: true

    version: 2

To use a static IP address 192.168.0.100, I will change the file so that it looks like this afterward:

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
 version: 2
 renderer: networkd
 ethernets:
   ens33:
     dhcp4: no
     dhcp6: no
     addresses: [192.168.0.100/24]
     routes:
      - to: default
        via: 192.168.0.1
     nameservers:
       addresses: [8.8.8.8,8.8.4.4]

IMPORTANT: The indentation of the lines matters. Add the lines as shown above.

Then restart your network to apply the changes:

sudo netplan generate

sudo netplan apply

Then edit /etc/hosts.

sudo nano /etc/hosts

Make it look like this:

127.0.0.1 localhost

192.168.0.100 server1.example.com server1

# The following lines are desirable for IPv6 capable hosts

::1 localhost ip6-localhost ip6-loopback

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

Now, we will change the hostname of our machine as follows:

sudo echo server1 > /etc/hostname 

sudo hostname server1

The first command sets the hostname “server1” in the /etc/hostname file. The system reads this file at boot time. The second command sets the hostname in the current session so we don’t have to restart the server to apply the hostname.

Alternatively, to the two commands above, you can use the hostnamectl command, which is part of the systemd package.

sudo hostnamectl set-hostname server1

Afterward, run:

hostname 

hostname -f

The first command returns the short hostname, while the second command shows the fully qualified domain name (FQDN):

root@server1:/home/administrator# hostname

server1

root@server1:/home/administrator# hostname -f

server1.example.com

root@server1:/home/administrator#

If you want to adjust the keyboard layout of the server, run this command:

sudo dpkg-reconfigure keyboard-configuration

Congratulations! Now, we have a basic Ubuntu 24.04 server setup that provides a solid basis for all Ubuntu Server setups.

9. Virtual Machine image

This tutorial is available as a ready-to-use virtual machine in OVA / OVF format for Howtoforge subscribers. The VM format is compatible with VMWare and Virtualbox, and other tools that can import the OVA or OVF format. You can find the download link on the right menu near the top. Click on the filename to start the download.

The login details of the VM are:

SSH Login

Username: administrator

Password: howtoforge

The administrator user has sudo permissions.

Please change the passwords after the first boot.

The VM is configured for the static IP 192.168.0.100. The IP can be changed in the file /etc/netplan/50-cloud-init.yaml as shown in the tutorial step 8. The keyboard layout of the downloadable VM is the US keyboard layout.

Ubuntu: http://www.ubuntu.com/