Recently I have installed a LAMP server in my Ubuntu Desktop 12.04 LTS.

Now how can I install Nginx and implement with my present LAMP Server?


To install Nginx in your Ubuntu , open your terminal and type as

sudo -i
add-apt-repository ppa:nginx/development
apt-get update 
apt-get install nginx

that will install nginx in your Ubuntu.


From Nginx Wiki:

Open a terminal and enter the commands (remember to replace the values!):

sudo -s
nginx=stable # use nginx=development for latest development version
ubuntu=trusty # Replace this with your ubuntu version!
echo "deb http://ppa.launchpad.net/nginx/$nginx/ubuntu $ubuntu main" > /etc/apt/sources.list.d/nginx-$nginx-$ubuntu.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C
apt-get update 
apt-get install nginx

Login as Root User and type command:

Command: (apt-get update && apt-get install nginx;)

This command will install default version of nginx that comes with ubuntu software repository with latest updates.

  • Hello and welcome to AU. Please edit our question in order to eliminate the need to login as root. Use sudo instead. You may also consider to add for which version of Ubuntu your answer is valid. – Marc Vanhoomissen Nov 29 '18 at 13:11

To install stable Nginx Open terminal and run the following commands:::

sudo su
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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