Current Location: Home> Latest Articles> How to Install Composer, Laravel, and Lumen Framework on Ubuntu 14.04

How to Install Composer, Laravel, and Lumen Framework on Ubuntu 14.04

gitbox 2025-06-13

1. Installing Composer

Composer is a PHP dependency management tool that helps you manage and install the required packages for your project easily. Below are the steps to install Composer on Ubuntu 14.04:

1.1 Install Dependencies

Before starting, make sure that the following packages are installed on your system:

$ sudo apt-get update
$ sudo apt-get install curl php5-cli

1.2 Download Composer Installation Script

Navigate to any directory and run the following command to download the Composer installation script:

$ curl -sS https://getcomposer.org/installer | php

The script will download the Composer.phar file to the current directory.

1.3 Move Composer.phar to a Global Path

To be able to access Composer globally, move the Composer.phar file to a global path:

$ sudo mv composer.phar /usr/local/bin/composer

Now, you can verify that Composer was successfully installed by running the composer command.

2. Installing Laravel

Laravel is a popular PHP framework that offers elegant syntax and powerful features, making web application development easier.

2.1 Create a Laravel Project

Navigate to the directory where you want to create the Laravel project and run the following command:

$ composer create-project --prefer-dist laravel/laravel myproject

The command will create a Laravel project named "myproject" in the current directory.

2.2 Start the Development Server

Navigate to the newly created project directory:

$ cd myproject

Then, run the following command to start the Laravel development server:

$ php artisan serve

You can now view your Laravel application by visiting http://localhost:8000.

3. Installing Lumen

Lumen is a lightweight version of Laravel, focused on building microservices and small APIs. Below are the steps to install Lumen on Ubuntu 14.04:

3.1 Create a Lumen Project

Navigate to the directory where you want to create the Lumen project and run the following command:

$ composer create-project --prefer-dist laravel/lumen mylumen

The command will create a Lumen project named "mylumen" in the current directory.

3.2 Start the Development Server

Navigate to the newly created project directory:

$ cd mylumen

Then, run the following command to start the Lumen development server:

$ php -S localhost:8000 -t public

You can now view your Lumen application by visiting http://localhost:8000.

By following these steps, you have successfully installed Composer, Laravel, and Lumen on Ubuntu 14.04. You can now start using these tools to develop your PHP projects.