LAMP Linux Mint

1. Update & Upgrade machine

Open the terminal (CTRL + ALT + T) and first update your Linux machine:

$ sudo apt-get update
$ sudo apt-get upgrade

2. Installing LAMP server

Next step is installing LAMP server, enter the following command:

$ sudo apt-get install lamp-server^

”^” at the end is not a typing error, it should be included

Say ”Y” to LAMP.

To check if Apache is working, go to your browser and go to the following URL: http://localhost

3. Setting up MySQL

To enter the MySQL terminal, enter the following command:

$ sudo mysql -u root

Afther this command, you’ll be in the mysql> prompt, where you should enter the following:

ALTER USER ‘root’@’localhost’IDENTIFIED WITH mysql_native_password BY ‘new-password‘;

Replace “new-password” with a strong password you will memorize.

Then exit mysql prompt by typing:


Now restart mysql using the command:

$ sudo service mysql restart

4. Installing php- phpmyAdmin

Enter in the terminal:

$ sudo apt-get install phpmyadmin

Press enter

Leave the default (Yes) and hit enter, unless you have a good reason to do otherwise.

Enter a password for phpMyAdmin to connect to the database, hit Enter – then you will be asked to re-enter the password to confirm it.

Check if it works, typing this in your browser:


You should get something like this

In case it doesn’t work (404 error), try the following commands in terminal:

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
sudo systemctl restart apache2

5. Installing PHP Extensions

PHP extensions are compiled libraries that allow various functionalities. To see the version, setup and the installed extensions of the PHP, do the following:

Open a text editor, copy paste the following code and save it as “phpinfo.php”:

<?php phpinfo(); ?>

Now that file needs to be copied to directory /var/www/html/

You can’t copy to this directory withouth root access. So open terminal and type:

sudo nemo

This will start the Nemo file manager with root privileges. Allowing you to copy/paste the file. After copying, type in your browser:


Next, install php imagick

apt install php-imagick -y

Now just restart the Apache2 server:

sudo service apache2 restart

You succesfully installed LAMP on Linux Mint!

If you got any suggestions, questions or feedback, please feel free to contact us: