Install Symfony CLI on Ubuntu 24.04

Install Symfony CLI on Ubuntu 24.04

The Symfony CLI is an open-source command line tool for building, running and managing Symfony applications written in PHP programming language. This tool streamlines common development tasks and improves the developer experience when working with Symfony. This tutorial explains how to install Symfony CLI on Ubuntu 24.04.

Prepare environment

Make sure PHP, Composer and Git are installed on the system.

Install Symfony CLI

Download archive file from GitHub repository:

wget -qO symfony.tar.gz https://github.com/symfony-cli/symfony-cli/releases/latest/download/symfony-cli_linux_amd64.tar.gz

Extract executable and place in the /usr/local/bin directory:

sudo tar xf symfony.tar.gz -C /usr/local/bin symfony

We can check Symfony CLI version as follows:

symfony -V

Remove the archive file as it is no longer required:

rm -rf symfony.tar.gz

Testing Symfony CLI

To verify that Symfony CLI is working correctly after installation, we can create a new project by using the following command:

symfony new myproject

If the command executes successfully, output similar to the following will be displayed, indicating that the project has been created and initialized correctly:

* Creating a new Symfony project with Composer
* Setting up the project under Git version control
  (running git init /home/ubuntu/myproject)

 [OK] Your project is now ready in /home/ubuntu/myproject

Uninstall Symfony CLI

To uninstall Symfony CLI, delete the executable file:

sudo rm -rf /usr/local/bin/symfony

Leave a Comment

Cancel reply

Your email address will not be published.