Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I set up a new VPS instance of Ubuntu and am wondering what the easiest way is to get up and running with a basic LAMP stack (i.e. which packages are required, which configuration options need to be tweaked, if any, etc.).

share|improve this question

12 Answers 12

up vote 92 down vote accepted
sudo apt-get install tasksel
sudo tasksel install lamp-server

It will install all the basic LAMP stack for you, prompt for MySQL root password, etc.

More specifically it will install the following packages, and their dependencies.

mysql-client-core-5.1 libwrap0 apache2
libaprutil1-dbd-sqlite3 tcpd
libapache2-mod-php5 apache2.2-common
apache2-utils php5-common
libaprutil1-ldap libaprutil1
php5-mysql mysql-server-core-5.1
libdbi-perl libplrpc-perl mysql-server
apache2.2-bin libdbd-mysql-perl
libnet-daemon-perl libapr1
mysql-server-5.1 libmysqlclient16
ssl-cert apache2-mpm-prefork
mysql-common mysql-client-5.1

You might also want to take a peek at the Ubuntu Server Guide.

share|improve this answer
excellent answer. Thanks. – Jay Jan 2 '11 at 19:06
You might want to consider APT tasks rather than tasksel to do this. See this: Should I use tasksel, tasks in APT or install regular metapackages? – gertvdijk Jul 21 '13 at 15:15


sudo apt-get install tasksel && sudo tasksel install lamp-server

in terminal or over ssh and everything should setup fine. If you have any issues please leave a comment and I will further assist you with your problem.

share|improve this answer
this is a repeat answer. please elaborate to distinguish between this answer and the answer that was accepted. maybe add a link? – Malachi Mar 1 '13 at 21:33
Please Check out the FAQ – Malachi Mar 1 '13 at 21:34

You can install Bitnami lampstack.(Package containing all necessary sub packages of LAMP).

First of all create an account in bitnami website to download the file. Then copy the file to your desktop (for convenience ). To provide read and exicution permission, Open terminal (Ctrl + Alt + T). and type

chmod 755 chmod  755 'location of

Better drag and drop the .run file from your desktop after typing chmod 755, press enter.

Now double click on the .run file. It will guide you through the installation process.

Thank you.

share|improve this answer

My Swiss Army knife command:

sudo apt-get install apache2 mysql-server mysql-client libapache2-mod-auth-mysql php5 php5-mysql libapache2-mod-php5 php5-mcrypt php5-curl php5-cli php5-gd phpmyadmin

share|improve this answer

Install Apache

sudo apt-get install apache2

Install PHP

sudo apt-get install php5 libapache2-mod-php5

Install MySQL

sudo apt-get install mysql-server

Install phpMyAdmin

sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
share|improve this answer

The easiest way to install LAMP with PHPMyAdmin is using:

sudo apt-get  install lamp-server^ phpmyadmin 

You don't even need to install taskel. More details can be found here.

share|improve this answer
I'd recommend APT Tasks too. Note that the caret (^) is not a typo in this answer. See also: Should I use tasksel, tasks in APT or install regular metapackages? – gertvdijk Jul 21 '13 at 15:14

On commandline the simplest way is probably to use tasksel:

sudo tasksel install lamp-server
share|improve this answer

I personally always find that installing the MySQL server and then PHPMyAdmin will install all the parts I need

sudo apt-get install mysql-server

(doing this first means it asks for the root account password to be set in advance)


sudo apt-get install phpmyadmin

It also gives you all the tools you'll need to administrate your MySQL server once it's installed :)

share|improve this answer

The packages are apache2 and libapache2-mod-php5. php5 has a number of additional modules, you may need some. List them with apt-cache search php5

Try revising your search or

sudo apt-get install apache2 libapache2-mod-php5

Enable php5 with

sudo a2enmod php5

Restart apache

sudo service apache2 restart

The following wiki pages can be very helpful if you are starting with apache.

Note- This answer was migrated from elsewhere. To add mysql install

sudo apt-get install mysql-server php5-mysql
share|improve this answer

Try EHCP (easy hosting control panel) ...

ehcp installation on a clean server will do the dirty job for you ...

share|improve this answer

It has LAMP as well as phpmyadmin integrated along with perl modules. Installs in /opt/lampp so can be installed/removed easily...

share|improve this answer

In Synaptic, click edit and mark by task. Then select LAMP Server and hit apply. Done.

share|improve this answer
+1 for providing a slightly more GUI:ish solution, even if it's not necessarily available on a VPS. – andol Jul 31 '10 at 6:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.