Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

What Is Laravel and How to Install It

This guide explains Laravel and shows how to install a new Laravel project on your computer or server.

How-To Guides2 min read11 steps

What is Laravel?

Laravel is a free framework for PHP. PHP is a language used to build websites. A framework is a ready-made toolbox. Instead of building login, routing and database code from nothing, you start with tools that are already there. Laravel is popular for web apps, shops and APIs.

What you need first

  • PHP, at a version that your Laravel release supports.
  • Composer. This is a tool that downloads PHP packages for you.
  • A database such as MySQL, if your app stores data.
  • SSH access if you install on a server. Ask Hostvento support whether your plan allows it.

Steps

  1. Open a terminal and check PHP:
php -v

This prints your PHP version.

  1. Check Composer:
composer --version

If it is missing, install it from the official Composer website.

  1. Go to the folder where you keep projects.
  2. Create a new Laravel project:
composer create-project laravel/laravel myapp

This downloads Laravel into a new folder called myapp. It may take a few minutes.

  1. Go into the folder:
cd myapp
  1. Start the built-in test server:
php artisan serve

Artisan is Laravel's own command tool. This starts a small test server.

  1. Open http://127.0.0.1:8000 in your browser. You should see the Laravel welcome page.

Set up the database

  1. Create an empty database and user in your control panel under MySQL Databases.
  2. Open the .env file in your project. It holds your settings.
  3. Fill in DB_DATABASE, DB_USERNAME and DB_PASSWORD.
  4. Build the tables:
php artisan migrate

Put it on hosting

Laravel's public entry point is the public folder. Your domain should point to that folder, not the project root. Keep the rest of the files outside the public web folder. Never share your .env file.

Tip: Laravel releases need different PHP versions. Check the official Laravel docs for your version before you install.

Quick recap

  • Laravel is a PHP framework that saves you time.
  • You need PHP and Composer.
  • Run composer create-project laravel/laravel myapp.
  • Test with php artisan serve.
  • Point your domain at the public folder.