Menu
User

DropVPS Team

Writer: Cooper Reagan

How to Install Magento 2 on Debian 12.11

How to Install Magento 2 on Debian 12.11

Publication Date

10/08/2025

Category

Articles

Reading Time

2 Min

Table of Contents

Magento 2 is a powerful eCommerce platform, and installing it on Debian 12.11 provides a secure and stable environment for your online store.

Step 1: Update System

Updating Debian ensures all packages are current, secure, and ready for Magento installation:

sudo apt update && sudo apt upgrade -y

Step 2: Install Apache, MySQL, and PHP

Magento requires a web server, database, and PHP extensions to run properly on your server:

sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql php-cli php-xml php-mbstring php-intl php-bcmath unzip composer -y

Step 3: Create Database

A dedicated database stores products, customers, and configuration safely for your Magento store:

CREATE DATABASE magento;
CREATE USER 'magentouser'@'localhost' IDENTIFIED BY 'StrongPassword123';
GRANT ALL PRIVILEGES ON magento.* TO 'magentouser'@'localhost';
FLUSH PRIVILEGES;

Step 4: Download Magento 2

Using Composer ensures you get the latest Magento version with all required dependencies:

cd /var/www/html
sudo composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento2

Step 5: Set Permissions

Proper permissions allow Apache to read and write Magento files without errors:

sudo chown -R www-data:www-data /var/www/html/magento2

Step 6: Configure Apache

A virtual host ensures your domain points to Magento and supports clean URLs for your store.

sudo a2ensite magento2.conf
sudo systemctl reload apache2

Step 7: Finish Setup in Browser

Complete installation using the Magento wizard by entering database and store details:

http://yourdomain.com
Linux VPS
U
Loading...

Related Posts