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

Create a Laravel project. We will name our project "site"

            composer create-project --prefer-dist laravel/laravel site "6.*"

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 site/public html

Change the current directory to your project folder:

            cd site

Make the storage folder and its subfolders writable.

            chmod -R 777 storage

Make the bootstrap/cache folder writable.

            chmod 777 bootstrap/cache

Set your 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

Download Laravel/UI package.

            composer require laravel/ui "^1.0" --dev

Generate frontend scaffolding

Install the login / registration scaffolding:

            php artisan ui bootstrap --auth


Alternatively, you could install a basic scaffolding:

            php artisan ui bootstrap

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, to make the "nvm" command available, or run the following:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/" ] && \. "$NVM_DIR/"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

If you closed and re-opened terminal, change the current directory to your project folder again:

            cd /var/www/site

Install Node.

            nvm install node

Compile the 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