How to Install Laravel Step-by-Step Guide 2026

How to Install Laravel: Step-by-Step Guide 2026

Laravel installation is relatively straightforward, but getting the environment right matters. A developer experimenting locally has different requirements from a team building a SaaS application, CRM, customer portal or API that will eventually run in production.

This guide explains how to install Laravel step by step, verify the installation, configure a database, understand the main installation options and avoid common setup mistakes. The instructions focus on Laravel 13, the current major Laravel release in September 2026.

What Do You Need Before Installing Laravel?

Laravel 13 requires PHP 8.3 or later. Laravel officially supports PHP 8.3, 8.4 and 8.5 for Laravel 13. For a standard local installation, you should have:

RequirementPurpose
PHP 8.3+Runs Laravel.
ComposerInstalls PHP dependencies.
Laravel InstallerCreates Laravel applications.
Node.js + NPM or BunBuilds frontend assets.
DatabaseStores application data.
Terminal / command lineRuns installation and Artisan commands.

Laravel’s current installation documentation specifically recommends PHP, Composer and the Laravel installer, plus either Node/NPM or Bun for compiling frontend assets. Production environments also require Laravel’s listed PHP extensions and server configuration.

Step 1: Check Your PHP Version

Open a terminal and run:

php -v

For Laravel 13 you need PHP 8.3 or newer. If the machine still uses PHP 8.2 or earlier, upgrade PHP before creating a Laravel 13 application.

You can also inspect enabled PHP extensions using:

php -m

This is useful when Composer reports that an extension such as mbstring, xml or curl is missing.

Step 2: Check Composer

Laravel uses Composer to manage PHP packages and framework dependencies. Check whether Composer is installed:

composer --version

If the terminal returns a Composer version, continue. If it reports that Composer cannot be found, install Composer before proceeding.

Step 3: Install the Laravel Installer

If PHP and Composer are already installed, install the official Laravel installer with Composer:

composer global require laravel/installer

Verify that the Laravel CLI is available:

laravel --version

If the operating system reports that laravel is not recognized or cannot be found, the most common reason is that Composer’s global binary directory is not included in the system PATH.

Step 4: Create a New Laravel Application

Move to the directory where you want the project and run:

laravel new example-app

Replace example-app with the project name you want. For example:

laravel new customer-portal

After Laravel creates the application, enter the new project directory:

cd example-app

Step 5: Install and Build Frontend Dependencies

Modern Laravel applications use Vite for frontend asset compilation. From inside the application directory, run:

npm install
npm run build

Or use Laravel’s documented combined workflow:

npm install && npm run build

If you choose a Laravel starter kit, frontend dependencies become even more relevant. Laravel’s current starter-kit ecosystem includes React, Vue, Livewire and Svelte options.

Step 6: Start Laravel

Run:

composer run dev

Laravel’s current development script starts the local development server, queue worker and Vite development server. Then open:

http://localhost:8000

If the Laravel application loads successfully, the installation is working.

A simpler backend-only option

For certain development or troubleshooting scenarios, you may also use:

php artisan serve

For a modern Laravel project with frontend assets and background processing, the current composer run dev workflow more closely matches Laravel’s documented setup.

Step 7: Verify the Laravel Version

Inside the project directory, run:

php artisan --version

This checks the framework used by the current application. By contrast, laravel –version checks the globally installed Laravel installer. Blog #4 in this campaign covers Laravel version-checking methods in greater detail.

Step 8: Understand the .env File

Laravel uses an .env file for environment-specific settings. Typical values include:

APP_NAME=Laravel
APP_ENV=local
APP_KEY=...
APP_DEBUG=true
APP_URL=http://localhost
DB_CONNECTION=sqlite

The .env file may contain credentials and environment-specific secrets, so it should not be committed to source control. In production, APP_DEBUG should be false because debug output can expose sensitive configuration information.

Step 9: Configure the Database

Laravel can work with SQLite, MySQL, MariaDB, PostgreSQL and SQL Server. SQLite is convenient for learning, prototypes and lightweight local environments. For MySQL, an .env configuration may look like:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=my_application
DB_USERNAME=root
DB_PASSWORD=

Then run the application migrations:

php artisan migrate

For business systems, choose the database based on application requirements rather than which option is easiest during installation.

Step 10: Confirm the Installation

Useful verification commands include:

php artisan --version
php artisan about
php artisan list

Finally, start the environment again with composer run dev and open http://localhost:8000. At this point you have a functioning Laravel development environment.

Alternative: Install Laravel Directly with Composer

Some developers prefer Composer’s create-project workflow rather than globally installing the Laravel installer. For a Laravel 13 application skeleton, you can use:

composer create-project laravel/laravel example-app "^13.0"

Then:

cd example-app
npm install && npm run build
composer run dev

The current Laravel application package on Packagist requires PHP ^8.3 and Laravel 13.x dependencies.

MethodBest suited for
laravel newRegular Laravel development and the clearest current documented workflow.
Composer create-projectDevelopers who prefer direct Composer project creation or version constraints.
Laravel HerdSimplified graphical local PHP/Laravel management.
Docker / Laravel SailTeams wanting containerized and reproducible environments.

Should You Use Laravel Herd?

Laravel Herd provides a graphical PHP and Laravel development environment. Laravel’s installation documentation presents Herd as an alternative for developers who want a more fully featured local PHP installation and management experience. It can be useful for developers who regularly switch between projects and PHP versions.

CONTENT-CLUSTER BOUNDARY

Keep operating-system-specific installation details in Blog #5 (Ubuntu) and Blog #6 (Windows). This article should stay global and OS-neutral so all three URLs have distinct search intent.

What About Laravel Sail and Docker?

Laravel Sail provides a Docker-based development environment. Containerization can be useful for teams because PHP, databases, Redis and other services can run inside standardized containers instead of depending entirely on each developer’s host operating system.

For a beginner who simply wants Laravel running locally, the normal Laravel installer is usually easier. For teams where reproducible environments matter, Docker/Sail deserves consideration.

Local Laravel Installation Is Not Production Deployment

Successfully running composer run dev does not mean an application is production-ready. A production environment may also involve:

  • Nginx, FrankenPHP or another application server
  • SSL/TLS and secure environment configuration
  • production database configuration
  • Redis, queues and workers
  • scheduled tasks
  • file/object storage
  • backups and monitoring
  • CI/CD
  • CDN
  • secret management
  • security hardening
  • application optimization

Laravel’s deployment documentation requires the web server to expose the application’s public directory rather than the project root, and production debug mode should remain disabled.

php artisan optimize

Common Laravel Installation Problems

ProblemWhat to check
1. php command not foundPHP is either not installed or not available in PATH. Start with php -v.
2. Composer command not foundRun composer –version. Install Composer or correct the system PATH.
3. laravel command not foundComposer’s global binary directory is probably missing from PATH.
4. PHP version is too oldLaravel 13 requires PHP 8.3+.
5. Missing PHP extensionComposer may report missing extensions such as mbstring, xml or curl. Check php -m and the server requirements.
6. Database connection errorCheck the database service, database name, credentials, port and .env configuration.
7. Frontend assets are missingRun npm install and npm run build, then start the development workflow.

Which Frontend Should You Use After Laravel Installation?

ApproachWhen it fits
BladeServer-rendered pages and conventional Laravel development.
LivewireReactive interfaces while keeping most development in PHP/Laravel.
Vue.js + Inertia.jsRicher client-side interactions while retaining Laravel routing and backend architecture.
Laravel API + Nuxt.jsA decoupled frontend when SSR, independent deployment or API-first architecture is important.

For a detailed decoupled architecture, link this article to Blog #8 — Laravel + Nuxt.js when that article is published.

How Much Does Laravel Installation Cost?

Laravel itself is open source, so there is no framework licence fee for creating a standard application. A basic local installation mainly requires developer time.

For a real business application, “Laravel setup” can extend into solution architecture, database design, authentication, API setup, Redis, queues, cloud infrastructure, Docker, CI/CD, monitoring, security, staging, backups and deployment.

The better commercial question is: “What does it cost to design, build, deploy and maintain the Laravel application we need?” That is addressed more directly by Blog #16 (global Laravel web application development cost) and Blog #2 (Laravel website development cost in India).

When Should a Business Get Professional Laravel Help?

Installing Laravel is easy compared with designing a maintainable production application. Professional development support becomes more valuable when the application involves:

  • SaaS architecture or multi-tenancy
  • complex user roles and permissions
  • payment gateways
  • third-party APIs
  • CRM/ERP integrations
  • high-volume queues or Redis
  • Vue.js or Nuxt.js
  • legacy-data migration
  • cloud infrastructure
  • high security requirements
  • CI/CD and scaling
  • ongoing maintenance

Conclusion

Installing Laravel 13 starts with a small set of requirements: PHP 8.3+, Composer, the Laravel installer, and Node.js/NPM or Bun for frontend assets. The core workflow is:

composer global require laravel/installer
laravel new example-app
cd example-app
npm install && npm run build
composer run dev

For an individual developer, that may be everything required to begin learning. For a business application, installation is only the first step. Architecture, frontend selection, APIs, authentication, database design, infrastructure, security, testing, deployment and long-term maintenance have a much larger impact on the success of the project.

Frequently Asked Questions

How do I install Laravel?

Install PHP 8.3+, Composer and the Laravel installer, then run laravel new example-app. Enter the project directory, run npm install && npm run build, and start the environment using composer run dev. The application should then be available at http://localhost:8000.

What PHP version is required for Laravel 13?

Laravel 13 requires PHP 8.3 or later and officially supports PHP 8.3, 8.4 and 8.5. If php -v reports PHP 8.2 or earlier, upgrade PHP before creating a Laravel 13 project.

Do I need Composer to install Laravel?

Yes. Composer is part of Laravel’s standard PHP dependency-management workflow. Laravel’s documented installation flow uses PHP, Composer and the Laravel installer.

Do I need Node.js to install Laravel?

Node.js does not execute Laravel’s PHP backend, but Node/NPM or Bun is normally used to compile frontend assets. Modern Laravel applications use Vite for frontend asset handling.

How can I check whether Laravel installed correctly?

Enter the project directory and run php artisan --version. You can also run php artisan about or php artisan list, then start the environment and open http://localhost:8000.

Leave a Reply

Your email address will not be published. Required fields are marked *