How to install Laravel 7 and composer in a server that has already installed WordPress on Ubuntu 18.04

Posted July 26, 2020 1.4k views
PHPWordPressPHP FrameworksUbuntu 18.04Laravel

Dear, friends.

My server is using WordPress on Ubuntu 18.04 with PHP 7.4 ([])

The WordPress is already installed and runs smoothly, and now i want to learn creating feature on my site using Laravel latest version.

My WordPress is installed in var/www/html folder, and i want to create the Laravel project in var/www/html/my-laravel-project

Please help guide me by recommend tutorial links, so i can learn it step by step, without breaking the WordPress and other related configuration.

Thank you.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi there @Technosatmedia,

First, I would strongly recommend enabling backups for your Droplet or creating a snapshot. That way if anything goes wrong, you could revert back to a working version.

Then you will need to install composer, you could do that by following the steps here:

Once you have composer installed you can install Laravel with the following commands:

  • First go to your /var/www/html folder:
cd /var/www/html
  • Then install Laravel:
composer create-project --prefer-dist laravel/laravel my-laravel-project

After that Laravel will be available at /var/www/html/my-laravel-project.

After that, you can follow Step 4 from this tutorial here on how to configure Laravel:


by Brian Hogan
In this tutorial, you'll install and get started with Composer on an Ubuntu 18.04 system.