Bagisto is an open-source eCommerce platform built on top of Laravel and Vue.js. It provides a wide range of features and functionalities, making it a great option for building online stores.
In this article, we will go over the steps for installing Bagisto on Debian 10. Before we begin, make sure you have a fresh installation of Debian 10 with a user that has sudo
privileges.
Install PHP and Composer
Bagisto is built on top of Laravel, which is a PHP framework. Therefore, we need to have PHP and Composer installed on our system.
To install PHP and the required PHP extensions, run the following commands:
sudo apt-get update
sudo apt-get install -y php7.3-cli php7.3-fpm php7.3-json php7.3-pdo php7.3-mysql php7.3-zip php7.3-gd php7.3-mbstring php7.3-curl php7.3-xml php7.3-bcmath php7.3-json
Next, we need to install Composer, which is a dependency manager for PHP. We can install Composer by running the following command:
sudo apt-get install -y composer
Install Node.js and NPM
Bagisto also uses Node.js and NPM (Node Package Manager) for building its front-end assets. To install Node.js and NPM, run the following commands:
curl -sL <https://deb.nodesource.com/setup_14.x> | sudo -E bash -
sudo apt-get install -y nodejs
After the installation is complete, verify that the correct versions of PHP, Composer, Node.js, and NPM are installed by running the following commands:
php -v
composer -v
node -v
npm -v
Install and Configure MariaDB
Bagisto uses a MySQL database to store its data. In this tutorial, we will be using MariaDB as the MySQL database server.
To install MariaDB, run the following command:
sudo apt-get install -y mariadb-server
After the installation is complete, start the MariaDB service and enable it to start automatically on boot:
sudo systemctl start mariadb
sudo systemctl enable mariadb
Next, we need to secure the MariaDB installation by running the mysql_secure_installation
script:
sudo mysql_secure_installation
This script will prompt you to set a password for the root
user, remove anonymous users, disable remote root login, and remove the test database.
Once the security configuration is complete, log in to the MariaDB shell using the root
user:
mysql -u root -p
Once you are logged in, create a new database and user for Bagisto by running the following SQL commands:
CREATE DATABASE bagisto;
CREATE USER 'bagisto'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON bagisto.* TO 'bagisto
[data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%2730%27%20height=%2730%27/%3e](data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%2730%27%20height=%2730%27/%3e)
To continue the installation, we need to clone the Bagisto repository from GitHub. Run the following commands to clone the repository and switch to the develop
branch:
git clone <https://github.com/bagisto/bagisto.git>
cd bagisto
git checkout develop
Next, install the required Composer dependencies by running the following command:
composer install
After the Composer dependencies are installed, copy the .env.example
file to .env
and update the database and other settings as needed:
cp .env.example .env
Next, generate an application key by running the following command:
php artisan key:generate
Now we need to install the NPM dependencies and build the front-end assets. Run the following commands to do that:
npm install
npm run production
Finally, run the database migrations and seeders to set up the database tables and sample data:
php artisan migrate --seed
At this point, Bagisto should be installed and ready to use. To start the built-in development server, run the following command:
php artisan serve
This will start the development server on http://localhost:8000
. You can access the admin panel at http://localhost:8000/admin
. The default username and password are admin
and admin123
, respectively.
Conclusion
In this article, we went over the steps for installing Bagisto on a fresh installation of Debian 10. We installed PHP, Composer, Node.js, and NPM, and set up a MariaDB database. We also cloned the Bagisto repository, installed the dependencies, and ran the necessary commands to set up the database and start the development server.
I hope this tutorial has been helpful for you. Happy coding!