Bagisto is an open-source eCommerce platform built on Laravel, offering a wide range of features and functionalities for businesses looking to establish or expand their online presence. Its flexibility and modular design make it an excellent choice for developers and entrepreneurs alike.
Before starting, ensure you have a running Ubuntu 23.04 system with root privileges. You’ll also need LAMP (Linux, Apache, MySQL, PHP) stack installed. Here’s how to prepare your system:
- Update Your System: Always start with an up-to-date system. Run the following command to update your Ubuntu server:
sudo apt update && sudo apt upgrade -y
- Install LAMP Stack: Bagisto requires a web server, MySQL, and PHP to function. Install Apache, MySQL, and PHP by executing:
sudo apt install apache2 mysql-server php php-cli php-fpm php-mysql libapache2-mod-php php-xml php-gd php-curl php-zip php-mbstring -y
After installation, start and enable Apache and MySQL to run on boot:
sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl start mysql
sudo systemctl enable mysql
Step 1: Create a MySQL Database for Bagisto
Bagisto requires a database. Use the following commands to create a MySQL database and user for Bagisto:
- Log in to MySQL:
sudo mysql -u root -p
- Create a database:
CREATE DATABASE bagisto;
- Create a user and grant privileges:
CREATE USER 'bagisto_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON bagisto.* TO 'bagisto_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Replace your_password
with a secure password.
Step 2: Install Composer
Composer is required to install Bagisto’s dependencies. Install Composer globally using the following command:
cd ~
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
Step 3: Download and Install Bagisto
- Download Bagisto: Navigate to the web root directory and use Composer to create a Bagisto project:
cd /var/www/html
sudo composer create-project bagisto/bagisto
- Permissions: Set the correct permissions for Bagisto files and directories:
sudo chown -R www-data:www-data /var/www/html/bagisto
sudo find /var/www/html/bagisto -type d -exec chmod 755 {} \;
sudo find /var/www/html/bagisto -type f -exec chmod 644 {} \;
Step 4: Configure Apache for Bagisto
- Create a new Apache configuration file for Bagisto:
sudo nano /etc/apache2/sites-available/bagisto.conf
- Add the following configuration, adjusting
ServerAdmin
andDocumentRoot
as necessary:
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/bagisto/public
<Directory /var/www/html/bagisto/public>
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
- Enable the new site and Apache rewrite module:
sudo a2ensite bagisto.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
Step 5: Finalize Bagisto Installation
Finally, navigate to your server’s domain or IP address in a web browser to complete the Bagisto installation through its web installer. Follow the on-screen instructions, providing the database details you created earlier.
After successfully installing Bagisto on your Ubuntu 23.04 server, consider Shape.host for hosting your eCommerce platform. Shape.host offers Linux SSD VPS services, ensuring high performance and reliability for your online store. With Shape.host, you can enjoy scalable solutions, robust security, and excellent customer support, making it easier to manage your Bagisto installation and grow your eCommerce business.