How To Install Laravel on Debian 10 Buster

Install Laravel on Debian 10 Buster

In this tutorial we will show you how to install Laravel on Debian 10 Buster. For those of you who didn’t know, Laravel is a free, open-source PHP web application framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern. It is a pretty new framework, but with a big potential to become one of the most popular PHP frameworks.

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 through the step by step installation Laravel on a Debian 10 (Buster) server.

Install Laravel on Debian 10 Buster

Step 1. Before we install any software, it’s important to make sure your system is up to date by running these following apt-get commands in the terminal:

Step 2. Installing Apache on Debian 9 Stretch.

We will be installing Apache with apt-get, which is the default package manager for Debian:

After installing apache services on your system, start all required services:

Allow Apache HTTP server via the firewall:

Step 3. Install MySQL.

Now that we have our web server up and running, it is time to install MySQL. MySQL is a database management system. Basically, it will organize and provide access to databases where our site can store information:

Step 4. Installing PHP.

To install the latest stable version of PHP version 7 and all necessary modules, run:

Step 5. Installing Composer.

The composer is required for installing Laravel dependencies. So use below commands to download and use as a command in our system:

Verify the installation by printing the composer version:

Step 6. Installing Laravel on Debian.

At the time of writing this article, the latest stable version of Laravel is version 5.7:

Navigate to Laravel code directory and use composer to install all dependencies required for Laravel framework:

After successfully installing all dependencies, set the proper permissions on all files:

Step 7. Set Encryption Key.

First, rename the .env.example file to .env in projects main directory. This will use to setup application environment for the project:

Then, generate base64 random number encryption key:

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

Step 8. Setup MySQL Database

You may also require creating a database for your Laravel application. Login to your MySQL server and create MySQL database and user:

Edit the .env file and update database settings:

Step 9. Apache Configuration

You can create a new Apache configuration file or edit Apache default virtual host configuration file 000-default.conf and update DocumentRoot to Laravel public directory as below:

Reload Apache configuration changes by restarting service:

Step 7. Accessing Laravel.

Open your browser, type your domain and assuming the installation is successful, a screen similar to the following will appear:

Install Laravel on Debian 10 Buster

Congratulation’s! You have successfully installed Laravel. Thanks for using this tutorial for installing Install Laravel on Debian 10 Buster system. For additional help or useful information, we recommend you to 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 a best deal!