Installing Ubuntu 16.04 LTS Server

I am a big fan of using Linux for various projects. It is lightweight, easy to install, free, well documented, stable, and did I mention free? There is a bit of a learning curve if you have only ever worked in the Windows or OS X worlds but Linux skills are definitely worth the time and effort to develop. There are a wide variety of distributions available however my go to distro is Ubuntu, specifically the Long Term Support releases. These LTS versions provide 5 years of security and maintenance updates which is great for a production environment. There are a wide variety of Ubuntu distributions available, check them out at www.ubuntu.com.

This post will cover a basic installation of Ubuntu Server 16.04.2 LTS 64-bit. This basic install will form the basis of many other posts and you want to get to the stage where you can almost do this with your eyes closed! I am assuming you are using some sort of hypervisor environment to host this server.

The first step is to obtain the installation ISO file here. There are a variety of download methods available, make sure you get the LTS version.

Transfer the ISO file to a location accessible by your preferred Hypervisor. For this example I have uploaded the ISO file to a Datastore on the ESXi host.

Create a Virtual Machine in your Hypervisor, you will need to have a rough idea of how much Memory, CPU and Disk Space to allocate and this will be determined by the workload you intend to run on the server. For this exercise I will allocate a conservative amount, these can be changed later to suit if you find they are inadequate.

I use ESXi 6.0 in my lab so I make the following alterations with other settings left as default:

  • Compatibility: ESXi 6.0 virtual machine
  • Guest OS family: Linux
  • Guest OS version: Ubuntu Linux (64-bit)
  • CPU: 1 Socket, 1 Core per Socket
  • Memory: 2GB
  • Hard Disk: 20GB
  • Network Adapter: 1 with Adapter Type set to VMXNET3 and connected to an appropriate Network
  • CD/DVD Drive 1: Datastore ISO file, point this to the ISO file you downloaded and make sure you tick the box “Connect at power on”

Power on the Virtual Machine and launch the Remote Console.

The first screen allows us to set the language.

Use the Arrow keys to select the appropriate Language and press Enter to continue.

In the absence of Australian English I will choose English.

The next screen provides us with a number of installation methods to choose from.

 

Use the Arrow keys to select “Install Ubuntu Server” and press Enter.

We now get to select the installation language and default language of the system.

 

Use the Arrow keys to select the appropriate Language and press Enter to continue.

Again, in the absence of Australian English I will choose English.

The next choice lets us set the time zone and the system locale.

 

Use the Arrow keys to select the appropriate Country or Territory and press Enter to continue.

Yay Australia!

The next step will allow us to configure the keyboard layout.

 

Feel free to select No here and try and select your keyboard from the vast array of options. I will choose Yes using the Arrow keys and press Enter to launch the detection process.

Follow the instructions on screen to press various keys and hopefully at the end you will have the correct keyboard layout. Mine came out as “us:intl” which works perfectly on my setup.

 

The installer will then go ahead and detect your hardware and further prepare the installation environment.

The next screen we encounter should be the network detection screen. The installer will attempt to detect a DHCP server on the network and automatically assign an IP address. I don’t have access to a DHCP server on the particular network segment I am installing this test server on so I receive the following notification screen.

 

Pressing Enter leads me to a choice of Network configuration methods.

 

As I know I don’t have access to DHCP I am going to choose “Configure network manually”.

 

My test network uses the network 192.168.100.0/24 so I am going to enter an appropriate IP and press Enter to continue.

The IP address I will use is 192.168.100.31 so I will enter 192.168.100.31/24. If you are puzzled by what the /24 means, google “CIDR notation”.

 

This screen is asking for the Gateway (Default Gateway), this is generally the address of the Router that leads to the internet.

Enter an appropriate address and press Enter to continue.

 

This screen is asking for the DNS server address/s.

These are generally provided by your ISP or could be internal addresses on your private network like your Internet router.

I run internal DNS services so I am going to enter the 2 private addresses shown separated by a space and press Enter to continue.

 

Think of an imaginative name for your server and enter it here.

Being Australian, I am not particularly imaginative when it comes to naming things. There are some mountains west of Sydney that appear blue from a distance so we called them the Blue Mountains. There is a desert in Western Australia that has lots of sand dunes so we called it the Great Sandy Desert. There is a mountain range that straddles NSW and Victoria that regularly gets snow in the cooler months so we called them the Snowy Mountains.

But I digress, I am going to call my server SVR-TEST01 and press Enter to continue.

 

Enter an appropriate domain name here.

If you are just messing around in a lab environment it won’t really matter what you put in here. If it is part of a wider network ask your friendly neighborhood network admin for the correct value.

Press Enter to continue.

 

Know we need to setup a user account.

Choose the full or display name for the account here. Press Enter to continue.

 

Enter the actual username for the account here. I always like to create a user called administrator but feel free to choose any appropriate name.

There are some usernames that cannot be used (admin, root) but the interface will let you know if you inadvertently try and use one of these reserved accounts.

Press Enter to continue.

 

Enter a suitable password here.

Password selection is an arcane topic that is beyond the scope of this post, for the purposes of this exercise make sure that it is at least 8 characters long and contains a mix of upper and lower case letters, numbers, and special characters (e.g. &*#%@).

Pressing Enter will take you to a screen requesting that you re-enter your password for confirmation.

 

The option to encrypt your home directory is presented here.

As this is a server system I would generally select No. Encrypting your home directory can cause issues with some types of applications that you may wish to install at a later date.

Press Enter to continue.

 

If your server can connect to the Internet, the installer uses geoip to make an educated guess as to your correct timezone.

If it gets it wrong, select No at this screen and manually select it.

 

We are now ready to setup our hard disks.

I highly recommend using the guided LVM option here. Using LVM (Logical Volume Management) provides a great deal more flexibility when managing your storage when compared to traditional partitioning methods (i.e the “Guided – use entire disk” option). Volumes can be resized and moved on the fly, can span multiple physical disks, don’t have to be physically contiguous and can be snapshotted. More detailed information is available here.

Select the “Guided – use entire disk and set up LVM” and press Enter to continue.

 

Confirm the disk you wish to partition (There should be only one!) and press Enter to continue.

 

Are you sure?

Use the Arrow keys to select Yes and press Enter to continue.

 

For this exercise we will use all of the space available to create the Volume Group.

Press Enter to continue.

 

This screen shows the configuration of the partitions the installer is ready to commit to disk.

Take note of the 2.1GB swap volume that has been created, this is equal in size to the amount of RAM we have allocated to the Virtual Machine in ESXi. Linux uses a dedicated swap partition/volume in a similar way to how Windows uses a paging file.

Select “Finish partitioning and write changes to disk” and press Enter to continue.

 

Last chance to change our mind!

Use the Arrow keys to select Yes and press Enter to continue.

 

Now it is time to configure the package manager. If you don’t have direct access to the internet and use a proxy, enter the details here.

Press Enter to continue.

 

On this screen we can configure Automated Updates.

If this was a system going into a production environment I would select “Install security updates automatically”.

For the purposes of this exercise, select “No automatic updates” and press Enter to continue.

 

We can now select any additional software packages we wish to install.

I tend to only select “standard system utilities” and “OpenSSH server” at this screen as any other applications can be easily added later. OpenSSH allows you to remotely access your server using an SSH client like Putty.

Use the Arrow keys and Space Bar to select the desired software and press Enter to continue.

 

If we were installing into a dual/multi boot configuration this screen would present a variety options.

As this is only a single boot installation simply select Yes and press Enter to continue.

 

And we are done!

Press Enter to continue.

 

The system should reboot and before long we will be presented with our newly installed servers login screen.

We are not quite done yet though!

Log in using the username and password that we created previously.

 

You will probably notice in the banner that appears after login that there are a number of updates available. To install these updates we need to issue the following command:

sudo apt-get update

This command tells apt, which is the Ubuntu software package manager, to go out to the internet and update the list of available updates. We preface the command with sudo as we need to run this command as an administrator (It is the same as “Run as Administrator” in Windows)

You will be prompted for your password before the command will execute.

 

Assuming your server has internet access, you will see output similar to above.

The next step is to download and install the available updates.

Issue the command:

sudo apt-get upgrade

Notice that you didn’t get prompted for a password when you used sudo this time. After you have entered your password for a sudo command, your administrative session lasts for 15 minutes until you need to enter it again.

 

apt will return a list of software that will be upgraded and give you the size of the download and the disk space that will be consumed by the upgrade process.

Press Y and Enter to proceed.

apt will download and install the listed packages, depending on your internet connection speed this may take a while.

When it has finished, it is a good idea to reboot the server by issuing the following command:

sudo reboot

Done!

Leave a Reply

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