Laravel environment construction (Ubuntu 18.04 LTS)

1. Install PHP 7.4



$ sudo apt-get update
$ sudo apt -y install software-properties-common
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update

You can now use apt with a repository where you can install PHP 7.4.



$ sudo apt install php7.4 php7.4-mbstring php7.4-dom

Install other necessary items as well.

Check if it was installed


$ php -v
PHP 7.4.12 (cli) (built: Oct 31 2020 17:04:09) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.12, Copyright (c), by Zend Technologies

If this happens, it's OK!

2. Install Comporser

In order to install Laravel, you also need to install Composer. Composer is PHP's package management tool, and it seems that you can manage packages efficiently by using Composer.


php -r "copy('', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

Use the command on the official website (



$ ./composer.phar -V
Composer version 1.10.1 2020-03-13 20:34:27

This is OK

Make Composer available at all times


$ sudo mv composer.phar /usr/local/bin/composer
$ sudo chmod +x /usr/local/bin/composer
$ composer -v
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
Composer version 2.0.7 2020-11-13 17:31:06

Omitted below.

Install the zip command


$ sudo apt install -y zip unzip

Install the zip command because the unzip command is required when installing Laravel.

Install Laravel 6.x


$composer create-project --prefer-dist laravel/laravel="6.*" laravel6

When you execute the following, a folder called laravel6 will be created under the execution folder, and the files required for Laravel will be saved in that folder.

You can use any name you like for laravel6

Start the server and check


$ cd laravel6
$ php artisan serve

SharedScreenshot.jpg If you access this screen and this screen appears, it's OK!

Recommended Posts

Laravel environment construction (Ubuntu 18.04 LTS)
[Flutter] Ubuntu 20.04 environment construction
Environment construction with Docker (Ubuntu20.04) + Laravel + nginx
Laravel8 ubuntu20
[Windows] WSL2 + Ubuntu + Node.js environment construction
Laravel + Docker Laradock usage environment construction
Building a Deep Learning environment (Ubuntu 20.04 LTS)
WSL2 + Ubuntu 20.04 Install Vivado in LTS environment
Laravel development environment construction with Docker (Mac)
[Java] Environment construction
Java environment construction
Laravel + MySQL + phpMyadmin environment construction with Docker
Docker environment construction
Try running ScalarDB on WSL Ubuntu (Environment Construction)
Protobuf and gRPC C ++ environment construction on Ubuntu 18.04
[Ubuntu 18.04] Environment construction for using PyTorch with RTX3090
Ubuntu18.04 LTS minecraft server java edition construction memorandum
[Environment construction] Eclipse installation
Server construction procedure Ubuntu18.04 server
Circle CI environment construction
Apache2 on Ubuntu20.04 LTS
Ubuntu 18.04.05 About LTS setup
Build Ubuntu 20.04 LTS desktop environment on Raspberry Pi 4 (+ Japanese)
Java + Spring development environment construction with VirtualBox + Ubuntu (Xfce4)
Rails6 development environment construction [Mac]
[Spring Boot] Environment construction (macOS)
Building WebGIS on Ubuntu20.04 LTS
Rails engineer environment construction ruby2.7.1
EC-CUBE4 environment construction (local edition)
Rails environment construction Rails5.2.1 ruby2.5.1 Catalina
Introduction to Metabase ~ Environment Construction ~
[Portfolio] Manage site with laravel APP implementation (Docker environment construction)
Record video on ubuntu18.04 LTS
Installing OpenMX on Ubuntu 18.04.5 LTS
[CCNA] Construction of Cisco device emulator environment (EC2 + Ubuntu + GNS3)
JavaFX environment construction in Java 13
Case that gave up environment construction of react with ubuntu
[Docker] Rails 5.2 environment construction with docker
Install raspi-config on Ubuntu 20.04 (LTS)
AtCoder Challenge Environment Construction (Java 8)
Build mate desktop environment on ec2 with terraform (Ubuntu 20.04LTS)
Offline environment construction Ruby edition
Docker × Spring Boot environment construction
[Rails / MySQL] Mac environment construction
[Docker] postgres, pgadmin4 environment construction
React environment construction with Docker
Offline environment construction CentOS edition
Create a development environment for Ruby 3.0.0 and Rails 6.1.0 on Ubuntu 20.04.1 LTS
Creating a dual boot environment for Ubuntu Server 20.04.1 LTS and Windows 10
Rails + MySQL environment construction with Docker
Node.js environment construction with Docker Compose
◆ Spring Boot + gradle environment construction memo
Environment construction for Servlet application development
Let's create Ubuntu environment with vmware
Environment construction with Docker for beginners
Ruby environment construction summary ~ mac version ~
Make a language! (JavaCC environment construction)
Ruby on Rails 6.0 environment construction memo
Build a XAMPP environment on Ubuntu
Rails on Docker environment construction procedure
Install Linux Mint 20 after Ubuntu 18.04 LTS