Magento Ecommerce Setup on UnderHost VPS
Setup Magento on UnderHost VPS. Requirements, installation, database configuration, SSL/TLS, performance optimization for online stores.
On this page
Magento is a powerful enterprise-grade ecommerce platform trusted by thousands of online stores. It offers unlimited products, advanced inventory management, flexible payment gateways, and extensive customization. However, it requires more server resources than WordPress, making UnderHost Cloud VPS the ideal hosting choice.
Why Choose Magento
- Enterprise-grade: Handles thousands of products, customers, and transactions
- Flexible payments: Integrates with every major payment processor (Stripe, PayPal, etc.)
- SEO-friendly: Built-in URL rewrites, sitemaps, meta tags
- Highly customizable: Thousands of extensions and themes available
- Mobile-ready: Responsive themes included, app-like experience
Tradeoff: Magento is more complex and resource-heavy than WordPress. Shared hosting often struggles; Cloud VPS is recommended.
System Requirements
| Component | Magento 2.x Requirement | UnderHost Recommendation |
|---|---|---|
| PHP | 8.1+ (8.2+ recommended) | PHP 8.2 FPM on aaPanel |
| MySQL | 5.7.23+ or MariaDB 10.2+ | MariaDB 10.5+ on Cloud VPS |
| RAM | 2GB minimum | 4GB+ for production stores |
| Disk Space | 2GB+ (more with products) | 50GB+ for product images, backups |
| CPU | 2 cores minimum | 4 cores+ for high traffic |
Shared vs VPS Hosting
Shared Hosting (Not Recommended for Magento):
- Limited PHP resources
- Shared MySQL (slow for large stores)
- File upload limits
- Limited customization
UnderHost Cloud VPS (Recommended):
- Dedicated resources (PHP, MySQL, CPU)
- Full SSH access for Composer, CLI tools
- Unlimited file upload size
- Complete control over extensions and themes
- Custom caching (Redis, Varnish)
Installation Steps
Step 1: Download Magento
cd /home/aaPanel/www/yourdomain.com
# Download Magento 2.4
wget https://github.com/magento/magento2/releases/download/2.4.6/magento-2.4.6.tar.gz
tar -xzf magento-2.4.6.tar.gz
rm magento-2.4.6.tar.gz
Step 2: Install Composer dependencies
cd /home/aaPanel/www/yourdomain.com
# Install dependencies
composer install
# May take 5-10 minutes
Step 3: Set permissions
chown -R www-data:www-data /home/aaPanel/www/yourdomain.com
chmod -R 755 /home/aaPanel/www/yourdomain.com
chmod -R 777 /home/aaPanel/www/yourdomain.com/var /home/aaPanel/www/yourdomain.com/pub/media
Database Setup
Create dedicated database for Magento:
mysql -u root -p
CREATE DATABASE magento_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'magento'@'localhost' IDENTIFIED BY 'strong_password_123';
GRANT ALL PRIVILEGES ON magento_db.* TO 'magento'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Run Magento installation:
cd /home/aaPanel/www/yourdomain.com
php bin/magento setup:install \
--db-host=localhost \
--db-name=magento_db \
--db-user=magento \
--db-password=strong_password_123 \
--admin-firstname=Admin \
--admin-lastname=User \
--admin-email=admin@yourdomain.com \
--admin-user=admin \
--admin-password=AdminPassword123! \
--language=en_US \
--currency=USD \
--timezone=America/New_York
Performance Tuning
Enable caching (critical for Magento):
# Install Redis (recommended)
apt install redis-server
systemctl enable redis-server
# Configure Magento to use Redis
# Edit app/etc/env.php and add Redis cache backend
Optimize MySQL:
- Enable query caching
- Tune buffer pool size (innodb_buffer_pool_size = 2GB+)
- Set max connections appropriately
Security Hardening
- HTTPS required: Install SSL certificate (Let's Encrypt free)
- Admin URL: Change from /admin to custom path
- File permissions: Keep var/ and pub/media writable only by web server
- Firewall rules: Limit MySQL port access to localhost only
- Regular backups: Backup database daily
Ongoing Maintenance
- Update Magento:
composer updatemonthly - Monitor logs: Check
var/log/for errors - Clean cache:
php bin/magento cache:flushafter changes - Monitor database: Regular optimization, backups
- Test backups: Verify restore procedure works
Magento's resource requirements exceed shared hosting limits. UnderHost Cloud VPS with at least 4GB RAM is recommended for production stores. Contact support for sizing recommendations.
Related: WordPress setup | Laravel deployment | MySQL setup | SSL certificates
Ready to start with UnderHost?
Compare UnderHost hosting, VPS, dedicated, offshore, and managed services to choose the right starting point.





















