Install Ubuntu Local Server

| Tutorials

It is essential for a developer to have his own server running on his local machine to develop web-apps and test them right on his own computer for a faster production.
I love Linux distros far more than WIndows. They are lighter, faster, safer, allowing me to run my laptop longer than I can on Windows (yes, I run my server on my Ubuntu installed on my lappy).

First of all, dump those multiple lined commands if you were going to do so. Installing LAMP on your Ubuntu takes only one command. Open your terminal and follow the following steps. At the end of the tutorial, you will have your server running with Apache, MySQL and Php along with PhpMyAdmin for database management as most of the people use PhpMyAdmin for creating and updating databases.

 

Install LAMP Server:

Open your terminal and paste the following command

sudo apt-get install lamp-server^

[This is not a typo. Do enter the ‘^’]

In the process, you will be asked to enter password for the ‘root’ user of your MySQL server. If you don’t specify any password, a random password will be generated. But, it is recommended to specify the password yourself.

And viola! You have your lamp server running. To test it, visit http://localhost/ and see it you can view the following welcome text

It works!

This is the default web page for this server.
The web server software is running but no content has been added, yet.

 

Install PhpMyAdmin:

PhpMyAdmin  is the most convenient way to create and manage MySQL Databases. You would probably want to install it for a faster for a hassle-free database management. To do so, please enter the following command on the terminal.

sudo apt-get install phpmyadmin

You would need to specify whether your are running on apache or lighttpd. Use the up and down arrows to specify your server and hit ENTER and continue with entering your passwords for the MySQL database and you would have PhpMyAdmin t

Try to visit http://localhost/phpmyadmin . If it lands you on the PhpMyAdmin page, then you don’t have to do anything more. If not (most probably it won’t be done by itself), read along.

Paste the following command on the terminal for opening a particular apache2 file (assuming you have installed apache, not lighttpd).

sudo gedit /etc/apache2/apache2.conf

Add the following line at the bottom of the file and save and close it,

# Include the PhpMyAdmin configurations:
Include /etc/phpmyadmin/apache.conf

Now, restart your apache with the following command

sudo service apache2 restart

Now, you should be able to access your PhpMyAadmin from http://localhost/phpmyadmin

sudo chown -R <username> /var/www

Replace <username> with your username.

And now you have a fully working local server on your Ubuntu, even if you are on a laptop it won’t drain much server resources.

I hope you would enjoy developing your codes on your local server and pace up your productivity.

If you have found this article valuable, feel free to share with others on social networking sites using the buttons below and comment at the bottom and I will get back to you.

Tags: , , , , ,


  • Sourish Mazumdar

    This one is really awsome man 🙂