How to upgrade a droplet with LEMP (NGINX 1.14.0, PHP, MYSQL) on Ubuntu 18.04?

I need to know how to update LEMP on Ubuntu 18.04 to the latest. I have created a droplet with LEMP and nginx/1.14.0. Because this is the version that was available in Digitalocean. I have hosted several websites on this single droplet.

Can someone give me step by step procedure on how to update this droplet? I need to update NGINX, PHP, MYSQL, and ubuntu to the latest versions. I believe this will be helpful to many users here. Thank you


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Pre-Built Packages for Mainline version on

Warning: The repository does not currently support Ubuntu 18.04. Support for Bionic should be available soon.

This will get you the latest version of Nginx. Use this version if you are a pro and if you really need the most actual Nginx build, as it may lack some Ubuntu specific integration and tweaks.

Download and add the PGP key to authenticate the Nginx repository signature: wget -qO - | sudo apt-key add -

Append the repositories to the end of the /etc/apt/sources.list file:

echo “deb bionic nginx” | sudo tee -a /etc/apt/sources.list

echo “deb-src bionic nginx” | sudo tee -a /etc/apt/sources.list

Update and install: sudo apt update && sudo apt install nginx