Ubuntu 12.04 Desktop as Ubuntu 12.04 Server With GUI has the advantage of using your Ubuntu Laptop or desktop to use it as Web Server, Accessing Remotely. There are differences between Ubuntu 12.04 Desktop and Server Edition, just like we pointed in a generalized article. Apart from installing web softwares like WordPress easily to test on your laptop or desktop, you can use it for the purpose of Private Cloud, it is becoming Bare Metal in that case; you can actually run a real Web Server to serve webpages or access your Ubuntu 12.04 Desktop as Ubuntu 12.04 Server With GUI as like we did the basically reverse process on a Ubuntu 12.04 Server. A bit knowledge of UNIX is needed for using Ubuntu 12.04 Desktop as Ubuntu 12.04 Server as basically few software packages, tweaking the system rightly can serve your dual purpose of using Ubuntu 12.04 Desktop as Ubuntu 12.04 Server With GUI.
Ubuntu 12.04 Desktop as Ubuntu 12.04 Server With GUI : Preface
The easiest way would be to use a fresh Ubuntu 12.04 Server Edition on your computer and configure it to use as desktop locally. But that is really not practical for the most as no one virtually will use as a serious server. This way to use Ubuntu 12.04 Desktop as Ubuntu 12.04 Server is also important to the new Ubuntu users who has upgraded their computer from Windows Operating System.
Ubuntu 12.04 Desktop as Ubuntu 12.04 Server With GUI : Steps
Before you are going to use your Ubuntu 12.04 Desktop as Ubuntu 12.04 Server, take a backup of all files and folders. This is important in case you make a mess. If you are really new, get a printout of this webpage to start working with Ubuntu 12.04 Desktop as Ubuntu 12.04 Server.
---
Our target for this guide for Ubuntu 12.04 Desktop as Ubuntu 12.04 Server with GUI are :
- Making your Desktop or Laptop an OpenSSH server so that you can connect from anywhere in this World through HTTP or SSH.
- Making the computer more secure by passwords, firewall etc.
- Installing basic LAMP stack. LAMP is Linux, Apache, PHP, MySQL.
- Basically we are not removing ubuntu-desktop.
Warning : Do not try to emulate this process of converting normally used Windows 7, Windows XP based desktop or Laptop with WAMP plus Cygwin. You will be hacked within few days because of file cross platform mismatched permissions.
You can check the official tech specs of a Server version :
1 | http://www.ubuntu.com/products/whatisubuntu/serveredition/techspecs |
Let us get started. First open the terminal by going to Applications > Accessories > Terminal and type :
1 | sudo apt-get update |
Then either manually open the sources.list file located at /etc/apt/sources.list or edit inside your console. The screenshot is of a remote server’s sources.lit file, but basic thing is, uncomment (remove the # and space) some lines to make them active and save the file :

Again do an update :
1 | sudo apt-get update |
And normally restart you computer. Run this :
1 | sudo apt-get install linux-headers-server linux-image-server linux-server |
Install Apache :
1 | sudo apt-get install apache2 |
And other components :
1 | sudo apt-get install php5 libapache2-mod-php5 |
And other MySQL components :
1 | sudo apt-get install httpd php mysql mysql-server php-mysql |
Restart Apache :
1 | sudo /etc/init.d/apache2 restart |
Create a test file to test :
1 | sudo gedit /var/www/foo.php |
gedit will open and add this code :
1 | <?php phpinfo(); ?> |
Now bind the local IP :
1 | gksudo gedit /etc/mysql/my.cnf |
Add this line or edit :
1 | bind-address = 127.0.0.1 |
Setup MySQL and PHP (one by one) :
1 2 3 | mysql -u root SET PASSWORD FOR 'root'@'localhost' = PASSWORD('changthistopassword'); quit |
Now, install :
1 | sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin |
Edit this file :
1 | gksudo gedit /etc/php5/apache2/php.ini |
Find this like and remove the semi colon :
1 | ;extension=mysql.so |
Restart Apache again :
1 | sudo /etc/init.d/apache2 restart |
Normally, if everything is right, if you open your browser to point towards :
1 | http://localhost/foo.php |
It should open an bluish colored informative table. Now install OpenSSH :
1 | sudo apt-get install openssh-server |
Setting up SSH is a big chapter, please see this guide :
1 | https://help.ubuntu.com/10.04/serverguide/openssh-server.html |
Start ssh :
1 | /etc/init.d/ssh start |
Ubuntu 12.04 Desktop as Ubuntu 12.04 Server With GUI : Specific Setup
The first important point is, you do not have an IP that you can actually access through internet. You can use your other computer or a Tablet PC to test for next steps.
Package Manager controls the entry or restriction to outside world. You basically need a VPN or if you have a router you can configure the IP address. That will expose the www folder to public. And with SSH you can login to your Ubuntu desktop. Now, it becomes up to you how you will configure and use your Ubuntu. If you want to use it as VNC Remote Desktop, follow the later part of this guide. If you want to install WordPress, follow this guide from the sub header ‘The actual command steps to install WordPress on Rackspace Cloud Server‘.
Usually there is no need to use a DNS and Domain Name. Use OpenDNS and BIND the IP to assign your computer’s location properly. With DNS you can actually use any domain name you want to configure.
In case server Edition, you will get a primitive GUI to install, you have to install desktop to work in that case. Basic is the same and basically not so difficult that no one can do. Error might arrive like with gnome, do a search to fix it.