Clean install of Ubuntu 12.04 LTS
Clean install of Ubuntu 12.04 LTS

How to install and configure a minimal Ubuntu server onto bare or virtual metal.

To test out some of our leadpages code (which relies on wildcard dns entries and .htaccess files) we built a small virtual server.

In this case we are using virtualbox (its quick and easy and for us works on osx – other platforms are available). Our server of choice was ubuntu 12.04 LTS.

As we sometimes setup servers for clients, we need to focus on reliability and sustainability over features – the LTS (Long Term Support) variants of ubuntu are supported for around 5 years, whereas their not LTS counterparts could have their support life measured in months. We don’t want to have to charge for a migration every year, and we haven’t met a client yet who wants to pay that often either.

Want to follow the ubuntu install without a virtual machine? skip ahead now.

So – Virtual Box loaded, lets hit new and away we go.

Were creating a 64 bit version of ubuntu (we’ve downloaded the ISO already), we set the options and pick a name (we are on mythical animals at the moment)

Choose the RAM you need – were picking 512M, I would’t recommend less, and this is a testing environment – if we were running the machine live then we would assign 1G, increasing with usage.

We then create a new virtual hard drive, minimum 5G – but you wouldnt fit much in there, we go for 20G and make it dynamically allocated (as we are only using virtualbox we chose a vdi drive, change it if you need to and only if you know why). When the drive is dynamically allocated it only takes up as much space on the host as it is actually using. This means you could allocate a lot more drive space than your host machine has, just make sure you keep your eye on it and don’t run out.

Nearly there – go into the settings, select storage, and choose the empty CD drive (under the IDE controller), click the little cd on the right and choose your iso – you may need to browse.

Select your server, and hit start.

Installing Ubuntu

The first thing you will see is the language selection screen, unless you want a real challenge, then I suggest you pick a language you can understand.

Choose Install Ubuntu Server, and then on the next screen… Choose your language, again… (just in case you decided you have changed your mind).

Pick your County/Territory – this really is for setting up the timezone of the server, so this should be the country the server resides in, not necessarily where you are right now.

Choose if you wish to detect keyboard layout – your choice, as its a server and we usually control those vie admin panels and ssh, it isn’t vitally important (you can choose of a list if you select no – we default to UK english irrespective of which keyboard we are currently using.)

After a few seconds you will be asked for a hostname, you could accept the default “ubuntu” or pick something more unique.

Pick an name for a non-admin administrator (root doesn’t have a password as standard, but this user will have full sudo privileges to gain elevated access.). The username follows immediately after, and then a password (obviously you are going to create a unique secure password for this machine even if its just for testing!!)

Encrypted home directory? For web hosting we want to choose no as the pages need to be accessible when we are not logged in.

You will be asked to double check your time zone, and then you will move onto disk partitioning.

In our cases we stick with the defaults.

The base package of ubuntu will now install.

In the middle of the install you will be prompted for a http proxy – if you don’t have one then just press enter, otherwise fill it in as required.

Choose if you want auto-updates or not, on our virtual machines we do, on live servers it depends on the clients circumstances.

On the software selection screen we choose OpenSSH Server and NOTHING else. we will install other parts later, but only as part of a script or manually.

Finally we will be asked about a bootloader – if this is the only operating system on this machine (or virtual machine) then just select yes.

Remove any CDs (virtual or otherwise – virtualbox will auto unmount iso images at this point) and select continue.

Your machine should then look similar to this.

Check you can log in and you will undoubtably have a few updates to perform.

type in and run:

sudo apt-get update

This will make sure that all updates have been found.
Then run:

sudo apt-get upgrade

select Y to upgrade, and then sudo reboot and repeat, you should have no updates left to install.

our final part will be to set a fixed ip address, and setup a fully qualified domain name (FQDN).

First the ip address.

sudo vi /etc/network/interfaces

the primary interface wants to read as follows (with the numbers being yours)

auto eth0
iface eth0 inet static

Next – Modify the hosts file

sudo vi /etc/hosts

change the first 2 lines to localhost.local localhost karkinos.flashwing.local karkinos

finally, edit /etc/hostname to be the following


You can now reboot and check everything is working correctly.

Want to set up apache for webhosting – then wait for our next post.

2 Comments Added

Add yours
  1. Andy September 25, 2013 | reply
    If you are using virtualbox and are unable to SSH into the machine - check that network settings inside virtualbox manager has the attached to: set to "Bridged Adapter"
  2. Pingback: How to host a website with Virtualmin | FlashwingFlashwing December 17, 2013

    […] Clean install of Ubuntu 12.04 LTS September 24 2013 READ IT […]

Leave a Reply to Andy Cancel Reply

Reset all fields