Easiest/safest way to get a fully updated LAMP droplet?

Posted August 25, 2019 2.6k views
DigitalOceanUbuntu 18.04

All 3 LAMP stacks on the DO marketplace have outdated/insecure components and the default PPA does not let me upgrade PHP, MySQL, Apache, PHPMyAdmin to their latest secure versions.

What would be the easiest/safest way to get a fully updated LAMP droplet?
(latest MySQL 5 or 8 would both be ok I guess)

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.

Submit an Answer
1 answer


What you can do is to backup your droplet and upgrade the components manually. In this was if anything goes wrong you will be able to revert the changes. Also before upgrading LAMP you need to make sure your application/site is compatible with the newer versions of PHP, MySQL and Apache, this is really important.

If you can provide more information about the droplet - what’s OS is using, I can give you more information about the process.


  • UBUNTU 18.04

    My droplet doesn’t have anything on it right now that I’m not willing to lose. Just a mostly fresh PHPMyAdmin OneClick droplet.
    I’d be more than willing to create a new fresh droplet for this.

    I also think that having a new tutorial (even if just as an answer to this question) available to future users coming across this issue would be worth starting over with a fresh droplet.

    If you are able and willing to explain how to install a fully updated LAMP stack (preferably with certbot and PHPMyAdmin as well) on a DO droplet, that would be really awesome. I don’t understand why there is nothing like this available for digitalocean at this time. I’m only finding very outdated information.

    As for my webapp, it’s running on fully updated WAMP for development, so I’m not worried about it not being compatible.

    • Could you please let me know which are the current versions of Apache, MySQL and PHP installed on your droplet?


      • It’s the default DO PHPMyAdmin One-Click install:

        Package / Version

        phpMyAdmin / 4.6.6
        MySQL Server / 5.7.23
        Apache / 2.4.29
        PHP / 7.2
        Certbot / 0.23.0

        • Hello and sorry for the delayed response.

          If it’s a blank or new droplet you can simply deploy a new one as it should have greater versions, although the provided versions are not that outdated.

          You can update phpMyAdmin manually using the following steps:

          1. Backup phpMyAdmin:

            mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak
          2. Download Latest phpMyAdmin (4.9.1):


            As I told the existing phpMyAdmin was installed with Apt package manager. Therefore you need to specify the TEMPDIR and CONFIGDIR location under the vendor_config.php file.

          Edit vendor_config.php file in your favorite text editor:

          vim /usr/share/phpmyadmin/libraries/vendor_config.php

          and update the following values.

          define('TEMP_DIR', '/var/lib/phpmyadmin/tmp/');
          define('CONFIG_DIR', '/etc/phpmyadmin/');

          Save the file and access check the phpMyAdmin version. You should be running the lastest version:

          Which version of MariaDB you would like installed on your droplet? The same question is valid for Apache and PHP.

          Have in mind that you can always try to upgrade the packages using apt-get

          Looking forward to your reply.