Deploy Laravel E-Commerce Site on CloudPanel

In this guide, we’ll look at how you can deploy a Laravel-based e-commerce site on CloudPanel. CloudPanel comes preconfigured with Laravel 9 and Laravel 10, but in this guide, we’ll use Laravel 10.

We will use a popular e-commerce site builder, Bagisto.

  1. On the CloudPanel dashboard, click the Add Site button. Click Create a PHP Site.

Under the Application, choose Laravel 10. Enter the domain, copy the password and click Create.

  1. Next, we’ll install SSL certificate. Click SSL/TLS then click Actions. Click New Let’s Encrypt Certificate. Then click create and Install.
  1. Let’s create a database for our site. Click Databases tab, then click Add Database. Fill in the database name and database user. Copy and store the database user password. Then click Add Database.
  1. Log in via SSH to the site user account. Use the password generated when creating the site. Via terminal, use this command:
ssh site-user@server-ip-address
  1. Go to htdocs and delete the directory which CloudPanel has created. Replace www.domain.com with your domain:
cd htdocs && rm -rf www.domain.com
  1. Create Bagisto project:
php8.2 /usr/local/bin/composer create-project --prefer-dist bagisto/bagisto -n www.domain.com
  1. We need to edit the env file to add the database and email credentials. Use this command:
cd www.domain.com && nano .env

Change the APP-URL to https://your-domain.com. Save the file after editing.

  1. Now, let’s install Bagisto on our server. Type the following command:
php artisan bagisto:install
  1. After installation, the site is up and running. Access your site through your browser. Take note of the admin email and password. You will use them to login to the admin dashboard. To access the admin dashboard, type https://yourdomain.com/admin

The Bagisto e-commerce has been deployed to your site.

Was this article helpful?

Related Articles

Leave A Comment?