Install Phpmyadmin on digital in ocean ubuntu 18.04

Install phpmyadmin on ubuntu

Hey guyz in this tutorial i will show you install phpmyadmin on digital ocean as you know phpmyadmin is a web application which you can easily control your mysql database and server. if you not setup your lamp first go to this link and setup your server click here.

Lets gets start

Step1. Install Phpmyadmin

In ubuntu repositories have phpmyadmin so just type following command

$ sudo apt update
$ sudo apt install phpmyadmin php-mbstring php-gettext

After typing command one by one and hit enter.

• He said choose your server if you are use apache2 choose on apache2 and click spacebar and hit enter.
• He asked for dbconfig-common choose yes and hit enter.

Afterwards, restart Apache for your changes to be recognized:

$ service apache2 restart

Step2. Config mysql root password

if you already change your mysql root password skip this setup if not setup follow this command.

$ sudo mysql

Type your password in YourPassword which color is red.

mysql> ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘YourPassword

You need to Flush Privileges by typing command below.


Also Read: Install SSL on digital ocean

Step3. Login in mysql for creating user

you need to login in your mysql paste the command.

$ sudo mysql -p

after typing command he ask for password type your password which you setup in previous setup.

Now create user for phpmyadmin you can also login by root credentials but not recommend thats why create new user and login through new user credentials.

Type your yourusername and your password and fill in command.

mysql> CREATE USER ‘yourusername’@’localhost’ IDENTIFIED BY ‘yourpassword‘;

After creating user you need grant all permission to perfom action.

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘yourusername’@’localhost’ WITH GRANT OPTION;

mysql> exit

Done your phpmyadmin install successful

For testing type in your browser


If open phpmyadmin login page login through your new user credentials.

Step4. Securing Phpmyadmin

If you install phpmyadmin you need secure your phpmyadmin from attacker or scammers.

Open phpmyadmin conf file

$ nano /etc/apache2/conf-available/phpmyadmin.conf

Phpmyadmin secure
Phpmyadmin secure

Change phpmyadmin to any name which you want to access your phpmyadmin through url ex:ok if you need to login in phpmyadmin go to


Learn More: Click Here

Thanks for reading this article Digital ocean Install phpmyadmin successfull if you have any doubt or suggestion leave comment or contact to

Hire Us for Digital Services :- Script Installation, Website Design & Development, VPS Configuration. Telegram Contact :-@Developer107