LinuxLinux MintTutorials

How To Install Laravel on Linux Mint 20

Install Laravel on Linux Mint 20

In this tutorial, we will show you how to install Laravel on Linux Mint 20. For those of you who didn’t know, Laravel is a very popular open-source PHP framework aimed at the easy development of applications. It is based on the Symfony framework and follows the model–view–controller (MVC) architectural pattern.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of Laravel on a Linux Mint 20 (Ulyana).


  • A server running one of the following operating systems: Linux Mint 20.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Laravel on Linux Mint 20 Ulyana

Step 1. Before running the tutorial below, it’s important to make sure your system is up to date by running the following apt commands in the terminal:

sudo apt update
sudo apt install software-properties-common

Step 2. Installing the LAMP stack.

A Linux Mint 20 LAMP server is required. If you do not have LAMP installed, you can follow our guide here.

Step 3. Installing Composer.

We are downloading and installing the Composer with the following commands:

curl -sS | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer

Step 4. Installing Laravel on Linux Mint 20.

By default, Laravel is not available on the Linux Mint base repository. Now we clone the master branch Laravel from the GitHub repository:

cd /var/www
git clone

Next, navigate to the Laravel code directory and use composer to install all dependencies required for the Laravel framework:

cd /var/www/laravel
sudo composer install

Then, set proper permissions on files:

chown -R www-data.www-data /var/www/laravel
chmod -R 755 /var/www/laravel
chmod -R 777 /var/www/laravel/storage

Step 5. Create Environment Settings.

Now create the Laravel environment configuration file:

mv .env.example .env

Next, create the key file with the PHP artisan command: php artisan key:generate
Application key [base64:EFk4kXxbmwe46+q/oF7hPnHm6mtechnsmfOMWd/qg=] set successfully.

After that, edit the .env configuration file and update the required settings. Also, make sure APP_KEY is properly set as generated in the above command:

nano .env

Edit the following file:


Step 6. Configuring MariaDB.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:


Configure it like this:

- Set root password? [Y/n] y
- 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

Next, we will need to log in to the MariaDB console and create a database for Laravel. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for Laravel installation:

CREATE USER 'laraveluser'@'localhost' IDENTIFIED BY 'Your-Strong-Passwd';
GRANT ALL PRIVILEGES ON `laraveldb`.* TO 'laraveluser'@'localhost';

Next, edit the .env file and update database settings:

nano .env

Add the following file:


Step 6. Configure Apache.

Now create an Apache virtual host configuration file for Laravel:

nano /etc/apache2/sites-available/laravel.conf

Add the following lines:

<VirtualHost *:80>

        DocumentRoot /var/www/laravel/public

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        <Directory /var/www/laravel>
                AllowOverride All

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined


Save and close the file then enable the Apache virtual host and rewrite the module with the following command:

sudo a2enmod rewrite
sudo a2ensite laravel.conf
sudo systemctl restart apache2

Step 8. Accessing Laravel Framework Web Interface

Once successfully installed, you can access your website on A congratulations page as follows should greet you:

Install Laravel on Debian 11 Bullseye


Congratulations! You have successfully installed Laravel. Thanks for using this tutorial to install the latest version of the Laravel PHP framework on the Linux Mint system. For additional help or useful information, we recommend you check the official Laravel website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!


r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button