How to Install Laravel 11 on Ubuntu 24.04
Last update: 06-09-2024
In this tutorial, we will guide you through the steps to install Laravel 11 on Ubuntu 24.04. Follow these steps to set up your Laravel development environment quickly and easily.
Step 1: Install PHP and Required Extensions
First, we need to install PHP and the necessary extensions. Open your terminal and run the following command:
sudo apt install php php-mbstring php-curl php-xml php-sqlite3 php-mysql
Step 2: Download Composer
Next, we need to download Composer, the dependency manager for PHP. Run the following command to download the latest stable version of Composer:
wget https://getcomposer.org/download/latest-stable/composer.phar
Step 3: Make Composer Executable
Next, we need to make the Composer file executable. Run the following command:
chmod +x composer.phar
Step 4: Move Composer to a Global Location
Move the Composer executable to a global location so that it can be run from anywhere:
sudo mv composer.phar /usr/local/bin/composer
Step 5: Verify Composer Installation
To ensure Composer is installed correctly, check its version by running:
composer --version
Step 6: Create a New Laravel Project
Now, we will create a new Laravel project. Replace project_name
with your desired project name:
composer create-project laravel/laravel project_name
Step 7: Navigate to the Project Directory
Move into the newly created project directory:
cd project_name
Step 8: Serve the Application
Finally, start the Laravel development server by running:
php artisan serve
You should see output indicating that the Laravel development server is running. Open your web browser and navigate to http://localhost:8000
to see your new Laravel application in action!
Congratulations! You have successfully installed Laravel 11 on Ubuntu 24.04. Happy coding!