Magento is an open-source eCommerce platform that provides a flexible shopping cart system and a wide range of features to manage your online store. In this guide, we will walk through the steps to install Magento on Debian 11.
Step 1: Update Your System
Start by ensuring your system is up to date:
sudo apt update && sudo apt upgrade -y
Step 2: Install Required Packages
Install the necessary packages for Magento:
sudo apt install -y apache2 mysql-server php libapache2-mod-php php-mysql php-cli php-curl php-mbstring php-xml php-zip php-gd php-soap php-intl php-bcmath
Step 3: Configure MySQL
Log in to MySQL to create a database and user for Magento:
sudo mysql -u root -p
CREATE DATABASE magento;
CREATE USER 'magento_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON magento.* TO 'magento_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Replace your_password
with a strong password of your choice.
Step 4: Download Magento
Download the latest version of Magento:
wget https://github.com/magento/magento2/archive/refs/tags/2.4.5.zip
Extract the downloaded archive:
unzip 2.4.5.zip
Move the extracted files to the web directory:
sudo mv magento2-2.4.5 /var/www/html/magento
Step 5: Configure Apache
Create a new Apache configuration file for Magento:
sudo nano /etc/apache2/sites-available/magento.conf
Add the following configuration:
<VirtualHost *:80>
DocumentRoot /var/www/html/magento/pub
ServerName your_domain.com
<Directory /var/www/html/magento/pub>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/magento_error.log
CustomLog ${APACHE_LOG_DIR}/magento_access.log combined
</VirtualHost>
Replace your_domain.com
with your actual domain name.
Step 6: Enable Apache Modules
Enable the necessary Apache modules and the new site configuration:
sudo a2enmod rewrite
sudo a2ensite magento
Step 7: Restart Apache
Restart Apache to apply the changes:
sudo systemctl restart apache2
Step 8: Set Permissions
Set the proper permissions for the Magento directory:
sudo chown -R www-data:www-data /var/www/html/magento
sudo find /var/www/html/magento -type d -exec chmod 755 {} \;
sudo find /var/www/html/magento -type f -exec chmod 644 {} \;
Step 9: Install Magento
Open your web browser and navigate to:
http://your_domain.com
Follow the on-screen instructions to complete the installation process.
Conclusion
You have successfully installed Magento on Debian 11. This powerful eCommerce platform will help you manage your online store effectively.
If you're looking for a reliable hosting solution for your Magento store, consider using Windows VPS UK. With Windows VPS, you can efficiently host your applications and ensure high performance. Whether you need VPS UK Windows or Windows Virtual Private Servers, you'll find a solution that fits your requirements.
For larger deployments or enterprise needs, explore Windows Virtual Dedicated Server Hosting or Virtual Private Server Hosting Windows. Whether you're located in the UK, Italy, or elsewhere, Windows VPS Italy and UK VPS Windows offer reliable hosting options. Visit Windows VPS Hosting UK to discover the best hosting solutions for your eCommerce needs.