Laravel requires PHP 7.3 or later, so you'll need to install PHP if it's not already installed on your system. To install PHP on Ubuntu, run the following command:
sudo apt-get install php
Laravel uses Composer to manage its dependencies. To install Composer, run the following commands:
sudo apt-get install curl php-cli git unzip
curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
Once you have PHP and Composer installed, you can use Composer to install Laravel. Run the following command to install the latest version of Laravel:
composer global require laravel/installer
When composer finish, type:
~/.bashrc
Paste and save:
export PATH="~/.config/composer/vendor/bin:$PATH"
Type on terminal:
source ~/.bashrc
Now that Laravel is installed, you can create a new project by running the following command:
laravel new project-name
Now that Laravel is installed, you can create a new project by running the following command:
Replace project-name with the name of your project.
Once the project is created, you can start the development server by running the following command:
php artisan serve
This will start the development server on http://localhost:8000.
That's it! You've now installed Laravel and created a new project. You can start developing your application using Laravel's powerful features and tools.
© 2025. All rights reserved by Viktor Molnar.