Tools: Start developing with Laravel on Ubuntu 24.04 LTS

Tools: Start developing with Laravel on Ubuntu 24.04 LTS

Prerequisites

Official method: PHP, Composer, and Laravel installer

Create the application

Verify it works

Alternatively: DDEV method Ubuntu 24.04 LTS is a solid base for learning web development. The Laravel docs recommend PHP, Composer, and the Laravel installer on your machine. This post follows that official path first, then shows the DDEV option if you prefer a container-based stack. The Laravel 12 installation guide uses php.new to install PHP 8.4, Composer, and the Laravel installer in one go. On Linux you run: Restart your terminal after it finishes. That gives you PHP, Composer, and the laravel CLI. You also need Node.js and npm (or Bun) to build frontend assets; install them via your package manager if needed (e.g. sudo apt install nodejs npm on Ubuntu). Create a new Laravel app. The installer will prompt you for testing framework, database, and starter kit: Then install frontend dependencies, build assets, and start the dev server: The app runs at http://localhost:8000. The composer run dev script starts Laravel's HTTP server plus the Vite dev server and queue worker. Open http://localhost:8000 in your browser. You should see the default Laravel welcome page. If you prefer to keep PHP and the database in containers, use DDEV. Follow the DDEV installation guide for Linux, then use the Laravel quickstart: create the project directory, configure DDEV for Laravel, start the containers, and install Laravel via Composer: ddev config sets the project type and document root. ddev start brings up the web and database containers. ddev composer create-project installs Laravel 12 inside the web container. The Laravel project type in DDEV automatically updates or creates the .env file with the database host, user, and password (db), so you don't run key:generate or edit .env by hand. ddev launch opens the app in your browser. Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Code Block

Copy

/bin/bash -c "$(curl -fsSL https://php.new/install/linux/8.4)" /bin/bash -c "$(curl -fsSL https://php.new/install/linux/8.4)" /bin/bash -c "$(curl -fsSL https://php.new/install/linux/8.4)" laravel new my-laravel-app cd my-laravel-app laravel new my-laravel-app cd my-laravel-app laravel new my-laravel-app cd my-laravel-app npm install && npm run build composer run dev npm install && npm run build composer run dev npm install && npm run build composer run dev mkdir my-laravel-site && cd my-laravel-site ddev config --project-type=laravel --docroot=public ddev start ddev composer create-project "laravel/laravel:^12" ddev launch mkdir my-laravel-site && cd my-laravel-site ddev config --project-type=laravel --docroot=public ddev start ddev composer create-project "laravel/laravel:^12" ddev launch mkdir my-laravel-site && cd my-laravel-site ddev config --project-type=laravel --docroot=public ddev start ddev composer create-project "laravel/laravel:^12" ddev launch - Ubuntu 24.04 LTS (desktop or server) - For the official method: no PHP/Composer required yet — the install script adds them. - For the DDEV method: Docker and Docker Compose.