Current Location: Home> Latest Articles> Installing Composer, Laravel, and Lumen on Ubuntu 14.04: A Comprehensive Guide

Installing Composer, Laravel, and Lumen on Ubuntu 14.04: A Comprehensive Guide

gitbox 2025-06-13

Installing Composer, Laravel, and Lumen on Ubuntu 14.04

1. Installing Composer

Composer is a dependency management tool for PHP, which helps manage and install various dependencies required by PHP projects. Below are the steps to install Composer on Ubuntu 14.04:

1.1 Install Dependencies

Before we begin, make sure that the necessary packages are installed on your system:

$ sudo apt-get update
<span class="fun">$ sudo apt-get install curl php5-cli</span>

1.2 Download the Composer Installation Script

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

<span class="fun">$ curl -sS https://getcomposer.org/installer | php</span>

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

1.3 Move Composer.phar to a Global Path

To make Composer accessible globally on your system, move the file to a global path:

<span class="fun">$ sudo mv composer.phar /usr/local/bin/composer</span>

You can now verify if Composer was installed successfully by running the composer command.

2. Installing Laravel

Laravel is a popular PHP framework known for its elegant syntax and powerful features that simplify web application development.

2.1 Create a Laravel Project

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

<span class="fun">$ composer create-project --prefer-dist laravel/laravel myproject</span>

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

2.2 Start the Development Server

Navigate to the newly created project directory:

<span class="fun">$ cd myproject</span>

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

<span class="fun">$ php artisan serve</span>

You can now access your Laravel application at http://localhost:8000.

3. Installing Lumen

Lumen is a lightweight version of Laravel, designed for 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 your Lumen project and run the following command:

<span class="fun">$ composer create-project --prefer-dist laravel/lumen mylumen</span>

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

3.2 Start the Development Server

Navigate to the newly created Lumen project directory:

<span class="fun">$ cd mylumen</span>

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

<span class="fun">$ php -S localhost:8000 -t public</span>

You can now access your Lumen application at http://localhost:8000.

Conclusion

By following these steps, you've successfully installed Composer, Laravel, and Lumen on Ubuntu 14.04. These tools are now ready for use in developing your own PHP projects. You can start building your web applications or microservices with ease.