Logo

dev-resources.site

for different kinds of informations.

How to Install Magento 2 on Shared Hosting ?

Published at
12/20/2024
Categories
magneto
frontend
developer
Author
maheshprajapati
Categories
3 categories in total
magneto
open
frontend
open
developer
open
Author
15 person written this
maheshprajapati
open
How to Install Magento 2 on Shared Hosting ?

Because of its resource requirements and server limitations, Magento 2 might be difficult to install on shared hosting. If the hosting environment satisfies Magento's minimal criteria, it is feasible.

Pre-Installation Checklist

1. Verify Hosting Requirements:

  • PHP version: 7.4+ (or the latest version supported by Magento).
  • MySQL version: 5.7+ or MariaDB 10.4+.
  • Elasticsearch: May not be available on shared hosting (required for Magento 2.4+).
  • PHP Extensions: intl, soap, bcmath, gd, mbstring, xsl, cURL, zip, etc.
  • Composer Support: Some shared hosting providers include Composer, or you can use it locally.

2. Secure FTP and Database Access:

  • FTP credentials for uploading files.
  • A database (MySQL/MariaDB) created through cPanel.

3. Magento Package:

  • Download the Magento 2 ZIP file from the Magento Downloads page.

4. Domain or Subdomain:

  • Ensure your domain or subdomain points to the shared hosting account.

Step-by-Step Installation

1. Upload Magento Files

  • Download the Magento 2 ZIP package.
  • Extract it locally and upload the contents to your server using FTP or cPanel's File Manager.

2. Set File Permissions

  • After uploading, set the correct permissions: Folders: 755 Files: 644
  • Some shared hosting environments might require additional permission adjustments for pub, var, and generated directories.

3. Create a Database

  • Log in to cPanel.
  • Go to MySQL Databases:
  • Create a new database.
  • Create a new user and assign it to the database with ALL PRIVILEGES.

4. Configure Magento Installation

Navigate to your domain or subdomain in a browser (e.g., https://yourdomain.com).

The Magento Setup Wizard will start:

  • Readiness Check: Ensure your hosting meets the requirements.
  • Add Database Details: Enter the database name, username, and password.

Web Configuration:

  • Specify the Base URL (e.g., https://yourdomain.com).
  • Enable/disable HTTPS based on your SSL setup.
  • Admin Account: Create an admin username, password, and email.
  • Installation Path: Magento will configure itself.

5. Post-Installation Tasks

  • Set File Permissions Again:
chmod -R 775 pub var generated
chmod u+x bin/magento

Enter fullscreen mode Exit fullscreen mode

You may need to do this via SSH or ask your hosting provider for assistance.

  • Run Indexers (Optional): If SSH access is available:
php bin/magento indexer:reindex
php bin/magento cache:flush
Enter fullscreen mode Exit fullscreen mode

Without SSH, Magento automatically handles this after installation.


6. Fix Common Shared Hosting Issues

  • Cron Jobs: Configure cron jobs via cPanel for Magento's background processes. Example:
*/5 * * * * php /home/username/public_html/bin/magento cron:run
Enter fullscreen mode Exit fullscreen mode
  • Elasticsearch Workaround: Magento 2.4+ requires Elasticsearch. If not available, use an earlier Magento version (like 2.3.x) or request Elasticsearch from your hosting provider.

Troubleshooting Tips

  • Slow Performance: Shared hosting is limited in resources; consider upgrading to VPS or cloud hosting.
  • Readiness Check Fails: Ensure all required PHP extensions are installed/enabled. Contact your hosting provider for assistance.
  • Composer Errors: Use Composer locally to install dependencies, then upload the files to the server.

Magento 2 may work on shared hosting for small-scale stores or testing environments. For a production site, VPS or dedicated hosting is highly recommended for better performance, security, and scalability.

magneto Article's
29 articles in total
Favicon
Boost Your eCommerce Success with the Best Magento 2 Extensions
Favicon
Boost Your eCommerce Success with the Best Magento 2 Extensions
Favicon
How to Install Magento 2 on Shared Hosting ?
Favicon
Magento 2 commands for maintenance and deployment
Favicon
Here's an easy way to create a Magento 2 eCommerce custom theme
Favicon
Hyva : How to create Read More Read Less Button
Favicon
Why Our Magento agency Stands Out in E-Commerce Excellence?
Favicon
Hyva release version: 1.3.10 for performance and User experience
Favicon
How Magento Ecommerce Can Drive Revenue and Growth for Your Business
Favicon
Hyva: Display PDP Sections as Tabs on Desktop and Accordion on Mobile
Favicon
Welcome to ViraXpress (Open source Magento frontend)
Favicon
Magento 2 ARM Ubuntu Server 24.04 AMD installation sh script
Favicon
How to Create a Dynamic Magento 2 Cart Page Using ReactJS
Favicon
Step-by-Step Guide: Setting Up Google Analytics 4 in Magento 2
Favicon
Creating a Custom Theme in Magento: A Step-by-Step Guide
Favicon
Common Misconfigurations that Make Magento Stores Vulnerable to Attacks
Favicon
Migration from Magento to Medusa: A Complete Guide for CTO
Favicon
Top Black Magic Specialist in Mumbai
Favicon
Magento Development Company
Favicon
Why Choose Magento 2 Maintenance Services: Know the Main Reasons
Favicon
What is Magento and Why Should You Use It for E-commerce?
Favicon
What is Magento 2 Payment Restrictions?
Favicon
10+ Best Sites to Hire Magento Developers
Favicon
Enhance Your Site with a Magento Website Audit Checklist 2024
Favicon
Technology Stack Comparison: Magento vs. Saleor
Favicon
Magento 2 Slack Notifier Module
Favicon
Best Magento Security Practices to Follow in an E-commerce Website Development Company
Favicon
Magento Web Development Company | Impinge Solutions
Favicon
What Are The Parameters of The around Method in Magento 2

Featured ones: