How to create your own server from an old pc using Ubuntu 12.04 LTS

We all are well aware that most of the servers run on Linux. Since Linux is very easy to learn these days, we are going to show you how to create a server from an old pc using Ubuntu 12.04. You need an old pc to use as a server or alternatively you can buy a computer from an online marketplace.

Visit the Ubuntu website and download a copy of latest Ubuntu 12.04 LTS and burn it on a CD/DVD. Alternatively you can use a USB disk as bootable media. You have to select the bootable media through the BIOS setting using F12. Since we are going to format the PC entirely, remove any important files from the PC first. Follow these steps carefully until the process is finished.

  1. Boot your Ubuntu from Bootable Media. Select the option Install Ubuntu. Select your language the OS should be installed in.
    Install Ubuntu Server on your local PC
  2. While selecting Install Ubuntu make sure you select Erase disk and Install Ubuntu.Use entire PC for Ubuntu Server Installation
  3. Now when the disk partition manager opens up, the first option will be erase and use entire disk which will be better as we are using it as a server.
  4. The file system is Ext 4 Journaling File System and the primary partition must have the /boot flag.
  5. You need to just click install after you selected the above option. In case you want a break, you can get a cup of coffee.
  6. Now the Ubuntu 12.04 features screen will be displayed, showing you whats new on it. Sit and watch while the installation takes place in the background.
  7. You will be prompted to enter username and password to continue with the system installation.
  8. After all the steps, you can login and you will have Ubuntu 12.04 installed on your PC.

Steps involved in converting a Ubuntu 12.04 desktop to Ubuntu 12.04 Server:

First you need to open the terminal by clicking Ctrl+X. Then you need to type the following commands as root.

  • Sudo tasksel

This will open a windows which looks like this:

Ubuntu Tasksel for removing desktop and installing ubuntu server

Just check Ubuntu Server and this will remove packages that are unnecessary like GUI etc.

Alternative way to convert Ubuntu desktop to server is to run a set of commands

  • sudo apt-get remove gnome-* (or) sudo apt-get purge ubuntu-desktop
  • sudo apt-get autoremove

Now you have a non GUI Ubuntu Server. Next you need to install LAMP Package on Ubuntu Server.

Run the following command

  • sudo apt-get install lamp-server^

This will start the process and in the middle you will be prompted to set MySQL password. Make sure you select a strong password.

When you open localhost on a browser on the machine, you must get a message like

It Works! This is the default page of this server

The IP address of the server is the IP that the PC uses to connect to the internet. Enjoy your PC based Server. Try different CMS and Web frameworks.

This is a simple and short way to install Ubuntu server on your local machine, but keep in mind that the PC functions as a server only if it is powered on.