How to Install Laravel 10 on Ubuntu 22.04 Nginx


To install laravel 10 on Ubuntu 22.04 nginx server, you need to open terminal window and type cd /var/www/html and composer create-project --prefer-dist laravel/laravel NewSetup command with laravel project directory name, it will install it.

How To Install and Configure Laravel 10 with Nginx in Ubuntu 22.04 Terminal

Here are some steps to install and configure laravel 10 with Nginx in ubuntu 22.04 using terminal or command line:

Step 1 – Install Required PHP Modules

Press ctrl+alt+t on keyboard to start start terminal window and type this command to update system packages and install php modules:

$ sudo apt update
$ sudo apt php-common php-json php-mbstring php-zip php-xml php-tokenizer

Step 2 – Creating a Database for Laravel

Create a MySQL database for Laravel application; so run following command on command line to create database for laravel app:

$ sudo mysql
MariaDB [(none)]> CREATE DATABASE laraveldb;
MariaDB [(none)]> GRANT ALL ON laraveldb.* to 'webmaster'@'localhost' IDENTIFIED BY 'tecmint';
MariaDB [(none)]> quit

Step 3 – Install Composer in Ubuntu 22.04

Now use the following command to install composer (a dependency manager for PHP) on ubuntu 22.04 system:

$ curl -sS | php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo chmod +x /usr/local/bin/composer

Step 4 – Install Laravel in Ubuntu 22.04 NGINX

Once the composer installation has been done; Now type the following command on command line to install laravel apps in ubuntu 22.04 nginx server:

$ cd /var/www/html
$ composer create-project --prefer-dist laravel/laravel

Step 5 – Configure Laravel in Ubuntu 22.04

Now configure laravel apps using the following commands:

Set permissions on the Laravel directory using the following command:

$ sudo chown -R :www-data /var/www/html/
$ sudo chown -R :www-data /var/www/html/
$ sudo chmod -R 0777 /var/www/html/

he default .env contains a default application key but you need to generate a new one for your laravel deployment for security purposes.

$ sudo php artisan key:generate

We also need to configure the Laravel database connection details in .env as shown in the following screenshot.

$ sudo nano /var/www/html/

Step 6 – Configure NGINX to Serve Laravel Application

Create a server block for it within the NGINX configuration, under the /etc/nginx/sites-available/ directory:

$ sudo nano /etc/nginx/sites-available/

Also, set the fastcgi_pass directive should point to the medium PHP-FPM is listening on for requests (for example fastcgi_pass unix:/run/php/php7.4-fpm.sock):

        root        /var/www/html/;
        index       index.php;

        charset utf-8;
        gzip on;
        gzip_types text/css application/javascript text/javascript application/x-javascript  image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
        location / {
                try_files $uri $uri/ /index.php?$query_string;

        location ~ \.php {
                include fastcgi.conf;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        location ~ /\.ht {
                deny all;

Save the file and then enable the Laravel site configuration by creating a link from /etc/nginx/sites-available/ to the /etc/nginx/sites-enabled/ directory. Besides, remove the default server block configuration.

$ sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/
$ sudo rm /etc/nginx/sites-enabled/default

Next, check if the NGINX configuration syntax is correct by running the following command before restarting the service.

$ sudo nginx -t
$ sudo systemctl restart nginx

Step 7 – Accessing Laravel Application from a Web Browser

Now open a web browser on the local computer and use the following address to navigate.


Through this tutorial, we have learned how to install and configure laravel on ubuntu 22.04 with nginx.

Recommended Laravel Linux Tutorials


Jaspreet Singh Ghuman

Jaspreet Singh Ghuman

Passionate Professional Blogger, Freelancer, WordPress Enthusiast, Digital Marketer, Web Developer, Server Operator, Networking Expert. Empowering online presence with diverse skills.

jassweb logo

Jassweb always keeps its services up-to-date with the latest trends in the market, providing its customers all over the world with high-end and easily extensible internet, intranet, and extranet products.


Jassweb, Rai Chak, Punjab, India. 143518
Item added to cart.
0 items - 0.00
نيك فى المساج فلم سكس لبناني
secretary xvideo animal and girl sex video
محجبة هايجة سحاق مايا خليفه
xnxxindean xnxximages
nayanthara xvideo pornstar list
صور سكس نياكه اكبربزاز
xxx indian sexy video desi nude outdoor
افلام جنسيه مترجمه عربي ام تتناك من صديق ابنها
www xnxx xxx2018
ولد ينيك امه مصري افلام سكس بث مباشر
x vidoi indian xxx video com
اجمل نيك فى الطيز نيك اجنبى
passion hentai most popular hentai
youporn india spicyplumpers
xxx dilli sexi video in hindi