Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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 installed server 10.10 with LAMP+OpenSSH. It is about 1.1GB. Can I reduce the total size of the server?


The full LAMP server is under 1.0gb

/dev/sda1             7.5G  914M  6.3G  13% /

It contains PHP/Mysql/Apache and Gearman-job-server with PHP support + libFAM

share|improve this question
Would something like Lighttpd or CherryPy be a suitable alternative for you? – Stefano Palazzo Nov 26 '10 at 13:50
Thenks for pointing the Lighttpd. But, we would like to stick with Apache and PHP. – Arman Nov 27 '10 at 13:36
up vote 5 down vote accepted

First off, consider using 32-bits if you are space conscious. The binaries are smaller, as is the memory footprint, and if you have a small disk footprint system, its likely you won't even have 4GB of RAM to take advantage of the 64-bit memory management.

If you just choose the "LAMP Server" task then base system + all of that can be a lot. However, LAMP itself is just Linux, Apache, Mysql, and PHP, so really all you need are the bits to tie those together. That would be:

mysql-server php5-mysql libapache2-mod-php5

Also you can try installing it with --no-install-recommends" which will avoid bringing in things that are normally used, but not absolutely necessary, for the operation of a LAMP site (like SSL, and the php CLI command).

SO you can run

apt-get --no-install-recommends install mysql-server php5-mysql libapache2-mod-php5

When I do this in a 64-bit EC2 10.10 instance I get this:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              15G  793M   14G   6% /
none                  290M  108K  290M   1% /dev
none                  297M     0  297M   0% /dev/shm
none                  297M   52K  297M   1% /var/run
none                  297M     0  297M   0% /var/lock

And on a 32-bit instance:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              15G  761M   14G   6% /
none                  294M  108K  294M   1% /dev
none                  298M     0  298M   0% /dev/shm
none                  298M   52K  298M   1% /var/run
none                  298M     0  298M   0% /var/lock

BTW, if you're curious where the space is used up:

sudo du -m /* | sort -rn | head -20

Will show you the top 20 (the numbers are MB of space used)

share|improve this answer
+1 for the "where's the space gone" command. Thanks! – David Oneill Nov 28 '10 at 15:18
Thanks for the nice explanation. I would like to know how can I do this if I use net installation? The apt-get --no-install-recommends does not uninstall the already installed packages... – Arman Nov 29 '10 at 8:10

LAMP server when compressed is of about 65 MB.It's about 200 MB when uncompressed.I am talking about the LAMP that the XAMMP people provide.UBUNTU installes a lot of stuff that it is considering to belong to the base... by taking away manually packages you get it down more...Sure,you can remove unnecessary libraries as long as you know what you do.You need to check what program depends on them and if you need those programs.if you have a library in ubuntu,it is because of a dependency..

share|improve this answer
what about the rest? can I remove some unnecessary libraries? – Arman Nov 26 '10 at 13:22
Yes you can.See my updated post – karthick87 Nov 26 '10 at 13:35
nice, thank you. It will be interesting to share the experience getting the minimum LAMP server running on ubuntu. – Arman Nov 26 '10 at 13:42

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.