Book Image

Mastering Ubuntu Server - Second Edition

By : Jay LaCroix
Book Image

Mastering Ubuntu Server - Second Edition

By: Jay LaCroix

Overview of this book

Ubuntu Server has taken the data centers by storm. Whether you're deploying Ubuntu for a large-scale project or for a small office, it is a stable, customizable, and powerful Linux distribution that leads the way with innovative and cutting-edge features. For both simple and complex server deployments, Ubuntu's flexible nature can be easily adapted to meet to the needs of your organization. With this book as your guide, you will learn all about Ubuntu Server, from initial deployment to creating production-ready resources for your network. The book begins with the concept of user management, group management, and filesystem permissions. Continuing into managing storage volumes, you will learn how to format storage devices, utilize logical volume management, and monitor disk usage. Later, you will learn how to virtualize hosts and applications, which will cover setting up KVM/QEMU, as well as containerization with both Docker and LXD. As the book continues, you will learn how to automate configuration with Ansible, as well as take a look at writing scripts. Lastly, you will explore best practices and troubleshooting techniques when working with Ubuntu Server that are applicable to real-world scenarios. By the end of the book, you will be an expert Ubuntu Server administrator who is well-versed in its advanced concepts.
Table of Contents (21 chapters)

Obtaining Ubuntu Server installation media

It's time to get started! At this point, we'll need to get our hands on Ubuntu Server and then create bootable installation media to install it. How you do this largely depends on your hardware. Does your server have an optical drive? Is it able to boot from USB? Refer to the documentation for your server to find out. In most cases, it's a very good idea to create both a bootable DVD and USB media of Ubuntu Server while you're at it. That way, regardless of how your server boots, you'll have what you need.

In the past, Ubuntu Server ISO images could be used to create either a bootable CD or DVD. Nowadays, writable CDs don't have enough space to support the download size. Therefore, if you choose to burn bootable optical media, you'll need a writable DVD at a minimum.

Unfortunately, the differing age of servers within a typical data center introduces some unpredictability when it comes to how to boot installation media. When I first started with servers, it was commonplace for all servers to contain a 3.5-inch floppy disk drive, and some of the better ones even contained an optical drive. Nowadays, servers typically contain neither and only ship with an optical drive if you ask for one nicely while placing your order. If a server does have an optical drive, it typically will go unused for an extended period of time and become faulty without anyone knowing until the next time someone goes to use it. Some servers boot from USB, others don't. To continue, check the documentation for your hardware and plan accordingly. Your server's capabilities will determine which kind of media you'll need to create.

Regardless of whether we plan on creating a bootable USB or DVD, we only need to download a single file. Navigate to the following site in your web browser to get started:

https://www.ubuntu.com/download/server

From this page, we're going to download Ubuntu 18.04 LTS by clicking on the Download button. There may be other versions of Ubuntu Server listed on this page, such as 18.10 and 19.04, for example. However, we're only interested in the Long Term Support (LTS) release, due to the fact that it benefits from five years of support (non-LTS versions are only supported for nine months). Non-LTS releases are useful for testing future software versions, but when in doubt, stick with LTS. Once the download is completed, we'll end up with an ISO image we can use to create our bootable installation media.

The ISO image we just downloaded is known as the live installer. This version is the default, and is preferred for most use cases. However, if you are performing a more advanced installation (such as installing Ubuntu with RAID) you may need the alternative installer instead. If you do need this version, you can get it by clicking on the link for alternative downloads page, and then on the next page you'll see an option for the Alternative Ubuntu Server installer. This special installer is covered in the appendix at the back of the book. Otherwise, we'll continue on with the standard installer.

If you're setting up a virtual machine, then the ISO file you download from the Ubuntu Downloads page will be all you need; you won't need to create a bootable DVD or flash drive. In that case, all you should need to do is create a VM, attach the ISO to the virtual optical drive, and boot it. From there, the installer should start, and you can proceed with the installation procedure outlined later in this chapter. Going over the process of booting an ISO image on a virtual machine differs from hypervisor to hypervisor, so detailing the process on each would be beyond the scope of this book. Thankfully, the process is usually straightforward and you can find the details within the documentation of your hypervisor or from performing a quick Google search. In most cases, the process is as simple as attaching the downloaded ISO image to the virtual machine, and then starting it up.

As I mentioned before, I recommend creating both a bootable USB and bootable DVD. This is due to the fact that you'll probably run into situations where you have a server that doesn't boot from USB, or perhaps your server doesn't have an optical drive and the USB flash drive is your only option. In addition, the Ubuntu Server boot media also makes great recovery media if for some reason you need to rescue a server. To create a bootable DVD, the process is typically just a matter of downloading the ISO file and then right-clicking on it. In the right-click menu of your operating system, you should have an option to burn to disc or some similar verbiage. This is true of Windows, as well as most graphical desktop environments of Linux when a disc burning application installed. If in doubt, Brasero is a good disc-burning utility to download for Linux, and other operating systems generally have this option built-in nowadays.

The exact procedure differs from system to system, mainly because there is a vast amount of software combinations at play here. For example, I've seen many Windows systems where the right-click option to burn a DVD was removed by an installed CD/DVD burning application. In that case, you'd have to first open your CD/DVD-burning application and find the option to create media from a downloaded ISO file. As much as I would love to outline the complete process here, no two Windows PCs typically ship with the same CD/DVD-burning application. The best rule of thumb is to try right-clicking on the file to see whether the option is there, and, if not, refer to the documentation for your application. Keep in mind that a data disc is not what you want, so make sure to look for the option to create media from an ISO image or your disc will be useless.

At this point, you should have an Ubuntu Server ISO image file downloaded. If you are planning on using a DVD to install Ubuntu, you should have that created as well. In the next section, I'll outline the process of creating a bootable flash drive that can be used to install.