Checklist: Installation of Laravel 6 on Centos 7

December 17, 2019

Checklist of the steps needed for a new installation of Laravel 6 on Centos 7 / Apache


1. Installation

Open a terminal window to your Centos server, and change the current directory to the web server root folder:

            cd /var/www

Install composer.

Follow the instructions indicated on the url


You could also get and install composer with curl:.

            curl -sS | php

Move the composer file to the /usr/local/bin folder.

            mv composer.phar /usr/local/bin/composer

Install the Laravel package.

            composer global require laravel/installer

Install Laravel.

            ~/.composer/vendor/bin/laravel new


If your server doesn't have the minimum required version of php, you will get a message error like this:

This package requires php ^7.2 but your PHP version (7.1.23) does not satisfy that requirement.

Remove the html folder. We are going to replace it.

            rmdir html

Replace the html folder with a link to Laravel's public folder.

            ln -s public html

Make the storage folder and its subfolders writable.

            chmod -R 777 storage

Make the bootstrap/cache folder writable.

            chmod 777 bootstrap/cache

Set the timezone and locale values on the config/app.php file.

'timezone' => 'UTC',

'locale' => 'en',


2. At this point, your site is up and working.

However, it doesn't have the Login and Sign Up functionality. If you want to install it, proceed with the next steps:

Enter your database credentials on the .env file.


Run the migration process, to create the users table.

            php artisan migrate

            composer require laravel/ui --dev

            php artisan ui vue --auth

Vue scaffolding installed successfully.
Please run "npm install && npm run dev" to compile your fresh scaffolding.
Authentication scaffolding generated successfully.

Install NVM.

            curl -o- | bash

At the time of this writing the latest version of NVM is v0.35.1.
Please check the current latest version at

Close and re-open terminal, and change the current directory to the web server root folder again:

            cd /var/www

Install Node.

            nvm install node

Compile Vue scaffolding.

            npm install
            npm run dev


3. Now your site is up and working, with the Login and Sign Up functionality.

If you don't need the Registration (Sign Up) functionality you can remove it:

Edit the routes/web.php file

Replace the line:


With the following:

            Auth::routes(['register' => false]);

Additionally you can also remove the RegisterController.php file. (optional)

Note for Docker users:

If the installation is going to be done on a Docker Container where a local folder of the host machine will be used as the web server root folder, the local folder should be mapped to "/var/www/", instead of "/var/www/html"

docker run -tid -p 4000:80 --name=container_apache -v /path_to/my_local_folder:/var/www/ image_apache

Additionally, on your local folder you should create the "html" folder before building/running the container:
mkdir /path_to/my_local_folder/html

The reason behind this is that the "html" folder will be removed, and it will recreated as a symbolic link from inside the container, and that cannot be done if the "html" folder is being used by Docker.

If the folder is mapped when trying to remove it, you will get the following error message:
rmdir: failed to remove 'html': Device or resource busy.


Related Posts