Magento hosting on dedicated servers
Magento needs a full stack of services around PHP, and all of them want memory. One dedicated machine runs the whole stack with room to spare, which keeps a mid-sized store fast and simple to operate.
What does a Magento store need?
More services than most PHP applications. Magento Open Source 2.4 expects PHP with a long list of extensions, MySQL or MariaDB, a search engine (OpenSearch on current releases), a key-value cache for sessions and pages (Redis or Valkey), Varnish as the full page cache, and optionally RabbitMQ for asynchronous operations. Composer installs the code. Each release publishes a system requirements table; match the PHP, database and OpenSearch versions to it exactly.
| Service | Role | Memory to plan |
|---|---|---|
| PHP-FPM | Application | 8 to 24 GB across workers |
| MySQL or MariaDB | Catalogue, orders, customers | 8 to 32 GB buffer pool |
| OpenSearch | Catalogue search and layered navigation | 4 to 8 GB heap |
| Redis or Valkey | Cache and sessions | 2 to 8 GB |
| Varnish | Full page cache | 4 to 16 GB |
| RabbitMQ | Message queues | 1 to 2 GB |
How do I install it?
With Composer into a folder owned by a dedicated user, then the setup command with connection details for every service.
sudo -u mage composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition /srv/mage/store cd /srv/mage/store && sudo -u mage bin/magento setup:install --base-url=https://store.example.com/ \ --db-host=127.0.0.1 --db-name=mage --db-user=mage --db-password="$DBPASS" \ --search-engine=opensearch --opensearch-host=127.0.0.1 --opensearch-port=9200 \ --session-save=redis --session-save-redis-host=127.0.0.1 --session-save-redis-db=2 \ --cache-backend=redis --cache-backend-redis-server=127.0.0.1 --cache-backend-redis-db=0 \ --admin-user=storeowner --admin-email=owner@example.com --admin-firstname=Store --admin-lastname=Owner --admin-password="$ADMINPASS"
The repository asks for access keys from your marketplace account, which are free to create.
What does production mode change?
It compiles dependency injection, deploys static assets once and disables developer conveniences, making every request faster. Switch to it before launch and repeat the compile steps after each code change.
sudo -u mage bin/magento deploy:mode:set production sudo -u mage bin/magento setup:di:compile sudo -u mage bin/magento setup:static-content:deploy en_GB en_US -j 8 sudo -u mage bin/magento cache:flush
Compilation needs a lot of memory; set the PHP CLI memory_limit to 4 GB.
How is Varnish set up?
Magento generates a Varnish configuration from its admin or the command line. Varnish listens on port 80 behind an HTTPS terminator such as nginx, nginx forwards to Varnish, and Varnish fetches from a separate nginx and PHP-FPM backend. Cached category and product pages are then served in a millisecond or two without PHP, and Magento purges the affected pages when products change.
Which cron jobs and indexers need attention?
Magento's cron runs indexers, emails, sitemap generation, price rules and queue consumers. Install it with bin/magento cron:install under the store's user, then check bin/magento indexer:status. Set indexers to "update by schedule" so product saves stay fast and changes are applied in small batches by cron.
What hardware carries the whole Magento stack?
Memory first, then fast cores for PHP. A single machine runs the full stack for most stores up to tens of thousands of orders a month.
| Store | Machine | Memory |
|---|---|---|
| Development and staging | ESSENTIAL-S | 64 GB DDR5 |
| Production, mid-sized catalogue | ESSENTIAL-L | 128 GB DDR5 |
| Busy store with heavy promotions | BUSINESS-5 2026 | 128 GB DDR5, 3 Gbps port |
ESSENTIAL-L pairs 128 GB DDR5 with 16 Zen 5 cores for $106.20 a month. Keep a second, smaller machine for staging so releases are tested on the same stack. Our OpenSearch clusters, Valkey servers and RabbitMQ servers pages go deeper into each supporting service.
How should backups work?
Database dumps nightly, plus the pub/media folder and the app/etc/env.php configuration, sent to another machine. Search indexes and caches can be rebuilt, so they need no backup. Test a restore to the staging machine monthly; it doubles as a check that staging matches production. The E-commerce shops page covers wider shop planning.
Machines for Magento stores
Lowest monthly price of each model across its data centres; the model page shows the price in every location.
| Model | Processor | Cores | Memory | Drives | Port | Per month |
|---|---|---|---|---|---|---|
| ESSENTIAL-S | AMD Ryzen 7 9700X | 8 | 64 GB | 2x 512 GB SSD NVMe | 1 Gbps unmetered | $46.20 |
| ESSENTIAL-M | AMD Ryzen 9 9900X | 12 | 64 GB | 2x 512 GB SSD NVMe | 1 Gbps unmetered | $70.80 |
| ESSENTIAL-L | AMD Ryzen 9 9950X | 16 | 128 GB | 2x 960 GB SSD NVMe | 1 Gbps unmetered | $106.20 |
| ESSENTIAL-5 | AMD EPYC 7413 | 24 | 128 GB | 2x 960 GB SSD NVMe | 1 Gbps unmetered | $120.00 |
| BUSINESS-4 2024 | AMD EPYC 4584PX | 16 | 64 GB | 2x 960 GB SSD NVMe | 3 Gbps unmetered | $180.60 |
| BUSINESS-5 2026 | INTEL Xeon 6527P | 24 | 128 GB | 2x 960 GB SSD NVMe | 3 Gbps unmetered | $406.20 |
Magento runs best with memory to spare for every service in its stack.
Related pages
E-commerce shops
Single machines and two node setups for WooCommerce, Magento, PrestaShop and headless shops that must stay fast at checkout.
Read morePrestaShop hosting
Host PrestaShop stores on your own server: PHP and database requirements, nginx rules, performance settings, cron for modules, security steps and sizing.
Read moreOpenSearch clusters
Run OpenSearch for search and logs on bare metal: heap and mmap limits, security plugin setup, shard sizing, index state management and node roles.
Read moreValkey servers
Run Valkey, the open-source in-memory data store, on bare metal: I/O threads across cores, clusters, persistence, moving over from Redis and sizing.
Read moreQuestions and answers
Which services does Magento Open Source need?
PHP, MySQL or MariaDB, OpenSearch for search, Redis or Valkey for cache and sessions, Varnish for full page cache, and optionally RabbitMQ.
What RAM does a Magento store with the full stack want?
A production store with the full stack on one machine usually needs 64 to 128 GB, depending on catalogue size and traffic.
Why use production mode in Magento?
It compiles code and deploys static assets once, which makes every request faster. Re-run compilation after each code change.
Does Magento work with Varnish?
Yes. Magento generates a Varnish configuration and purges cached pages when products or categories change.
How should Magento indexers run?
Set them to update by schedule and install Magento's cron so changes are indexed in small batches.