How to Install Lighttpd Stack on Centos (with Pictures)
Edit Article

  • 1 Editor

If you’re looking for a way to optimize the speed of your web server and not compromise on the performance, we have just the right thing for you. Lighttpd is a great alternative of Nginx and Apache which does exactly that for you. If you’re running a low end VPS and you’re looking for speed and performance then say hello to Lighttpd. This tutorial will explain to you how to install Lighttpd, PHP 5 (php-fmp), and MariaDB mysql on your CentOS 7. There is another great thing about this article. The total time it will take for you to set up all these things on your VPS is just under 15 minutes.

So you must be wondering why Lighttpd is better than Nginx. Well the answer to that is that it is not. Personally I think that both Nginx and Lighttpd both have the same performance levels if compared. And I honestly think that both of them are till faster than Apache. But coming back to Nginx vs Lighttpd, I would prefer and suggest Nginx. The main reason for choosing Nginx is that Nginx has a very large amount of users who are presently using it which makes it a very big active community too. So I would tell you not to opt for Lighttpd on production servers unless you are willing and planning to learn a lot more about it. But if you’re still bent on going for Lighttpd then this here article will do you suffice.


  1. The first important thing is a piece of hardware (server) that is running CentOS 7. For the extent of this tutorial I will be using a CentOS 7 x86_64 minimal.
  2. You should know how to use SSH client. You should be fine using Putty but if you have Linux or Mac then you can also use terminal as well.
  3. A basic knowledge of all the common Linux commands should also be at hand.
  4. 15 minutes of your spare time and a cup of coffee with it.


The only reason why this process is guaranteed to finish less than 15 minutes is because we will be using Lighttpd auto installer. This mentioned auto installer provides you with the ability to download and install the Lighttpd stack. The Lighttpd stack includes PHP 5 with fpm and MariaDB mysql server. This auto installer will also execute all the necessary and needed commands and tasks.


The very first things that you need to do here is login to your server and follow the guide to setting up CentOS. Before you go ahead and build a live web server you need to be sure that CentOS is up and running. If you follow the tutorial that I gave you earlier, you will notice that we did some tweaks to the server. If you follow that tutorial, you will now have a server that has been tweaked for security.

Now before we go on and proceed to the next step, this should be explained that all and every command we will be writing in this tutorial will be written without using the “sudo” prefix. But in case you have disable the root login and you are logged in by using another username which also has root privileges then you can simply go ahead and add the “sudo” prefix where needed all by yourself. There is an alternative way to all this as well. You can just simple type su. Now you hit enter and type your password in two times so that you may switch your login from the other username to root.



The second step that you need to perform is to type the command that is given below and then hit enter:

wget -O - |bash

When you enter this command, the auto installer script for Lighttpd should automatically start:



The above started script should finish quickly. Once this finishes which will normally take around 3 to 5 minutes, you will see something that will look a bit like this:



By now you should have full Lighttpd stack which includes Linux, MySQL, PHP and Lighttpd installed on your VPS. Now you will set up your MySQL root password. To do that you will need to issue this command:


I have written another article on how to configure MariaDB. If you want more information about this step you can go ahead and read that.


That is it. You are now running Lighttpd on your server. You have successfully installed the whole Lighttpd stack on your server which is now ready to use. I am providing you with some details that I monitored after installing the Lighttpd stack on my low end server.

PHP Version: 5.4.16


Lighttpd Version: 1.4.35


Used Memory After Install:

The very best thing about this all is that it consumes a very low amount of memory. This is why it will run excellently on low end servers which are running at least 128MB of RAM.


If you want, you can now access the newly installed Lighttpd stack on your browser.


That was it for the tutorial. Hope you enjoyed it.

Article Tools

Did this article help you?


an Author!

Write an Article