DEV Community

Quazi Mohammad Aldin Fardin
Quazi Mohammad Aldin Fardin

Posted on

How To install Laravel 9x on your Ubuntu

To install Laravel 9x on your Ubuntu machine from scratch, you can follow these steps:

1.Install PHP and other dependencies:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php8.2 php8.2-cli php8.2-mbstring php8.2-xml php8.2-zip

Enter fullscreen mode Exit fullscreen mode

2.Install Composer:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
Enter fullscreen mode Exit fullscreen mode

3.Install Laravel:

composer global require laravel/installer

Enter fullscreen mode Exit fullscreen mode

4.Add the Composer global bin directory to your PATH:

echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc
source ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

5.Create a new Laravel project:

laravel new myproject

Enter fullscreen mode Exit fullscreen mode

6.Start the development server:

cd myproject
compose install
php artisan serve

Enter fullscreen mode Exit fullscreen mode

now you can see your browser

Image description

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay