Setup PHP 7.3/mysql/mariadb/phpmyadmin on Ubuntu 20.04 [Digitalocean Droplet]

Setup PHP 7.3/mysql/mariadb/phpmyadmin on Ubuntu 20.04 [Digitalocean Droplet]

I’ve used digital ocean droplet for this. You can buy using my referral link (if haven’t bought it yet)

[Benefits] Get $100

If you use the referral link you will get $100 in credit over 60 days. Once you’ve spent $25 on Digitalocean(after the credit over), I’ll get $25.

Install Apache

sudo apt update
sudo apt install apache2

Once apache installation done — run this commands

sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl enable apache2.service

Install PHP 7.3

sudo apt-get install php7.3

if any confirmation comes — select Yes.
Install few necessary extensions

sudo apt install php7.3-cli php7.3-fpm php7.3-json php7.3-pdo php7.3-mysql php7.3-zip php7.3-gd php7.3-mbstring php7.3-curl php7.3-xml php7.3-bcmath php7.3-json

Once done — restart the apache server

sudo systemctl restart apache2

check php version installed using

php -v

Install MariaDB

sudo apt install mariadb-server mariadb-client

once done — run this commands

sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

Setup the installation

sudo mysql_secure_installation

When prompted, answer the questions below by following the guide.
Enter current password for root (enter for none): Just press the Enter
Set root password? [Y/n]: Y
New password: Enter password
Re-enter new password: Repeat password
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y
Once done restart the service

sudo systemctl restart mariadb.service
sudo systemctl restart apache2

Now you can run mysql

sudo mysql


Install Phpmyadmin

sudo apt install phpMyAdmin
Select apache2 on window pop up.
Configure database for phpmyadmin with dbconfig-common?
Select NO
Once installed run
sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin
sudo systemctl restart apache2

Then https://serverIP/phpmyadmin
Should work.

Previous Post
How to Setup Shopify CLI on windows 10
Next Post
Publish Laravel Site from Github