Skip to content

Ubuntu Server and first steps

Exercise ubuntu-server-and-first-steps-annex.pdf · PDF

Think of the last WhatsApp message you received. It passed through a computer in a data centre before it reached your phone. What does that computer's screen look like?

It has no screen. It sits in a rack with thousands of others, in a room with no chairs, and nobody ever looks at it. Today you install that kind of system: Ubuntu Server, with no desktop, no mouse, and a black screen with a line of text. It looks less impressive than yesterday's Debian. It is what runs most of the internet.

What you will learn

  • What a server is and why it usually has no desktop
  • Install Ubuntu Server 26.04 LTS in the VM ubu-srv with the keyboard only
  • Log in on a text console and find out who and where you are, with seven commands
  • Why administrators use sudo instead of working as root all day
  • The two halves of an update: apt update and apt upgrade
  • Why a server without a desktop is not an "unfinished" system

A computer nobody sits at

A server is a computer whose job is to answer other computers, not a person sitting in front of it.

Nobody looks at a server, so a graphical desktop would only waste RAM and add programs that can fail or be attacked. A server is managed with commands, usually from another computer.

deb-lab (yesterday) ubu-srv (today)
Installer Graphical, with the mouse Text screens, keyboard only
After login A desktop A black screen with a line of text
RAM given 4 GB 2 GB
Its job Your work machine The office server of Unit 6

Careful: no desktop does not mean old or limited

It is the same Linux, the same family of kernels, the same commands. It just does not spend RAM drawing windows that nobody will look at.

Meet Ubuntu

Ubuntu appeared on 20 October 2004, made by Canonical, the company founded by the South African Mark Shuttleworth. It is built from Debian — yesterday's system — so it uses the same package tool, apt, and the same commands.

Ubuntu follows a fixed calendar: a new release every six months, numbered year.month. 26.04 means April 2026 (released on 23 April). Every two years, the April release is an LTS — long-term support — with five years of security updates. Servers run LTS releases because nobody wants to reinstall a server every six months.

Install with the keyboard

Connect virt-manager to the class server with today's slip, as in Installing Debian (File → Add Connection → Custom URI... → qemu+ssh://<user>@<server>/session), select the connection and create the VM from your plan: ISO typed as /srv/isos/ubuntu-26.04.1-live-server-amd64.iso (not Browse Local), memory 2048, CPUs 2, disk 20 GiB, name ubu-srv, network Bridge device... with Device name virbr0. In the boot menu choose Try or Install Ubuntu Server.

The installer has no mouse. Learn four keys:

Key What it does
Tab and the arrows Move between options
Space Tick or untick a box
Enter Accept

The screens, in order, with our answers (the Exercise sheet has them too; the wording on your screen is the authority):

Screen Answer
Language English
Installer update available Continue without updating
Keyboard configuration Layout Spanish → Done
Type of installation Ubuntu Server (not minimized)
Network configuration Wait until an address 192.168.122.x appears → Done
Proxy empty → Done
Archive mirror Wait for the test to pass → Done
Guided storage Use an entire disk, keep Set up this disk as an LVM group ticked
Storage summary Read it → Done → in the red box, Continue
Profile Your name student · server's name ubu-srv · username student · password twice
Upgrade to Ubuntu Pro Skip for now
SSH configuration Tick Install OpenSSH server with Space
Featured server snaps Tick nothing
Installing system Wait for Reboot Now, then press it

Four screens to understand, not just click:

  • Network. The address 192.168.122.x comes from the virtual router virbr0 on the class server — the same family of addresses your earlier VMs got.
  • The red box (Confirm destructive action) is yesterday's Write the changes to disks?: the point of no return for the disk.
  • OpenSSH server. SSH is the way to type commands on a server from another computer. That is how real servers are managed, since they have no screen — and how virt-manager reaches the class server. You tick it today and use it in Unit 6.
  • Ubuntu Pro is Canonical's paid support plan (free for a few personal machines). The system is complete without it.

If it says Please remove the installation medium, then press ENTER, press Enter.

Your first login

After the reboot the screen fills with messages and stops. If no login: line is visible, press Enter: start-up messages were printed over it. Type student, Enter, then the password (nothing is shown while you type), Enter.

A welcome text appears, then the prompt:

student@ubu-srv:~$

The prompt tells you who you are (student), on which machine (ubu-srv) and in which folder (~, your home folder). The $ means "ordinary user". Now ask the machine about itself:

whoami                 # who am I?
hostname               # which machine is this?
cat /etc/os-release    # which system? (line PRETTY_NAME)
ip -br a               # my addresses
free -h                # RAM: total and used
df -h /                # the root file system: size and used
lsblk                  # disks and partitions
Command Expected answer
whoami student
hostname ubu-srv
cat /etc/os-release Ubuntu 26.04.1 LTS
ip -br a an address 192.168.122.x (ignore lo)
free -h a total of about 1.9Gi
lsblk vda with three partitions

Where is the other half of the disk?

The disk has 20 GB, but df -h / shows a root file system of only about 10 GB. Nothing is broken. The installer set the disk up with LVM (the box you left ticked) and on purpose gave the system only part of the space. The rest is kept free so it can be handed out later without reinstalling. You will grow it live in Unit 4. Write the number down.

The master key: root and sudo

Every Linux has one all-powerful user, root. It can read, change and delete anything, with no questions asked. Ordinary users can only touch their own files.

Back in the kitchen: the manager has a master key to every room; each cook has the key to their own locker. Working as root all day is walking around with the master key always in the lock: one wrong command, and nothing stops it.

So on Ubuntu root's login is disabled, and trusted users borrow the master key for one command by writing sudo in front of it.

sudo runs one command as root, after checking your own password.

apt update          # as student: refused
sudo apt update     # as root, for this one command

The first line fails with a message that ends in Permission denied: the system is saying "you need the master key". The second asks for your password and works. Borrowing the key instead of owning it gives you three things:

  • Mistakes need an extra word. You cannot destroy the system by accident with a normal command.
  • Every admin action has a name on it. sudo writes in a log who did what.
  • Nobody shares a root password. Each person uses their own.

Careful: sudo asks for your password, not root's

Root has no password here at all. What matters is that your user belongs to the group that is allowed to use sudo — the groups command on deb-lab showed it. Whether the password shows nothing or asterisks while you type depends on the system and its version: both are normal.

The two halves of an update

Picture a shop with a catalogue and a shelf:

flowchart LR
    M["<b>Mirror</b><br>the supplier's<br>warehouse"] -->|"sudo apt update<br>downloads the new catalogue"| C["<b>Package list</b><br>what versions exist<br>(installs nothing)"]
    C -->|"sudo apt upgrade<br>compares and installs"| S["<b>Your system</b><br>newer versions<br>on the shelf"]
  • sudo apt update downloads the newest catalogue: the list of packages and versions on the mirror. It installs nothing.
  • sudo apt upgrade compares the catalogue with what is installed and installs the newer versions.

Always in that order. If you run only the second one, it works from an old catalogue and believes there is nothing new. Package managers get a full page of their own later in this unit.

sudo apt update
sudo apt upgrade

The first ends with a line saying how many packages can be upgraded. The second lists them and asks [Y/n]: press Enter. If a purple screen asks about restarting services, use Tab to reach Ok and press Enter.

Switch off properly, then snapshot

A server is never switched off by closing its window — the VM keeps running behind it, on the class server, using RAM the whole class shares. Ask the system to shut down:

sudo poweroff

When the VM is off: View → Snapshots → + → name clean → Finish.

What a desktop costs

Start deb-lab, open a terminal and run free -h and df -h /. Compare with ubu-srv, then shut deb-lab down. You will see it with your own numbers: the desktop machine uses several times more RAM while doing nothing, and several GB more disk. That difference is the price of the desktop. Keep your numbers: the comparison of the three installs starts from them.

Key takeaways

  • A server answers other computers; with nobody in front of it, a desktop only wastes resources.
  • Ubuntu (2004, Canonical) is built from Debian; 26.04 LTS gets five years of security updates.
  • The prompt student@ubu-srv:~$ tells you who you are, where, and that you are an ordinary user ($).
  • root holds the master key; sudo borrows it for one command after checking your own password.
  • apt update refreshes the catalogue; apt upgrade installs the newer versions — always in that order.
  • Shut a server down with sudo poweroff, never by closing its window.

Quick check

1. What does sudo in front of a command do?
  • Runs that one command as root, after asking your password
  • Runs the command faster by giving it more CPU
  • Logs you in as root until the machine restarts
  • Downloads the command from the mirror before running it

sudo lends you root's power for one command. It checks that it is really you by asking for your password, and it records who did what.

2. What does sudo apt update do on its own?
  • Downloads the fresh list of available packages
  • Installs the newest version of every package
  • Upgrades Ubuntu to its next release
  • Restarts the server to apply the changes

apt update refreshes the catalogue and installs nothing. The new versions arrive with apt upgrade, which you run afterwards.

3. Ubuntu 26.04 is an LTS release. What does that mean?
  • It gets security updates for five years
  • It can only be installed on servers
  • It is a test version for developers
  • It must be paid for after one year

LTS stands for long-term support. That is why servers use LTS releases: five years of security updates without reinstalling.

4. Why does a server usually have no graphical desktop?
  • Nobody sits at it, so a desktop wastes RAM and adds things that can fail
  • Linux servers are not able to draw windows on a screen
  • A desktop slows down the network card of the server
  • Server licences forbid installing a desktop environment

A server works for other computers. A desktop would use RAM and disk for windows no one looks at, and every extra program is one more thing that can break or be attacked.

5. You type apt update without sudo and it fails with Permission denied. Why?
  • Refreshing the package list needs administrator rights
  • The mirror refuses connections from new servers
  • The command only works on Debian, not on Ubuntu
  • Your password expired during the installation

Changing the system's package list is an admin action. An ordinary user is refused; with sudo in front, the same command works.

6. On ubu-srv the 20 GB disk shows a root file system of about 10 GB. Select the two that are true.
  • The installer kept free space on purpose with LVM
  • The free space can be given to the system later without reinstalling
  • Half of the disk was lost because of an installer error
  • The missing space is used by the graphical desktop

With LVM, Ubuntu's installer gives the system only part of the disk and keeps the rest in reserve. You will grow it live in Unit 4. And ubu-srv has no desktop at all.

7. What does the prompt student@ubu-srv:~$ tell you?
  • The user, the machine, the folder, and that you are an ordinary user
  • The user, the IP address, the disk, and that you are root
  • The machine, the Ubuntu version, the time, and the language
  • The user, the password length, the folder, and the network

The prompt reads who@which machine:which folder. ~ is your home folder, and $ marks an ordinary user (root's prompt ends in #).

Two free systems installed in two days, with no key, no account and no special hardware. The next one asks for all three: Installing Windows 11.