On this page
- What do you need before installing WooCommerce?
- How do you prepare PHP for a store?
- How do you install WooCommerce?
- How do you make background jobs reliable?
- How do order emails reach customers?
- Which pages must never be cached?
- How do you secure the shop?
- How do you back up and update a store safely?
- Questions
What do you need before installing WooCommerce?
A shop is a WordPress site with stricter needs: more memory, reliable background jobs, working email and HTTPS everywhere. Build the base first by following WordPress on Nginx, PHP-FPM and MariaDB, or deploy the WordPress app image and add your domain and certificate.
- PHP 8.2 or newer with the
intl,gdorimagick,mbstring,xml,zipandcurlextensions. - A valid TLS certificate. Browsers and payment plugins expect the whole store on HTTPS.
- At least 2 GB of RAM for a small catalogue; more if you run many extensions or large product imports.
- A domain with working A and AAAA records, and a plan for outgoing email.
Check what you have with php -v, php -m and free -h before you start.
How do you prepare PHP for a store?
Raise the memory, upload and execution limits so product imports and report pages do not time out. On Ubuntu 24.04 the FPM settings live in /etc/php/8.3/fpm/php.ini; on Debian 12 replace 8.3 with 8.2, on Debian 13 with 8.4.
sudo sed -i -e 's/^memory_limit = .*/memory_limit = 512M/' \
-e 's/^upload_max_filesize = .*/upload_max_filesize = 64M/' \
-e 's/^post_max_size = .*/post_max_size = 64M/' \
-e 's/^max_execution_time = .*/max_execution_time = 120/' /etc/php/8.3/fpm/php.ini
sudo systemctl restart php8.3-fpm
cd /var/www/example.net
sudo -u www-data wp config set WP_MEMORY_LIMIT 256MThen check the pool size in /etc/php/8.3/fpm/pool.d/www.conf. A rough guide is one pm.max_children per 60 to 80 MB of RAM you can spare for PHP after MariaDB and Redis take their share.
How do you install WooCommerce?
Use WP-CLI so the install is repeatable and does not depend on the dashboard uploader.
cd /var/www/example.net
sudo -u www-data wp rewrite structure '/%postname%/' --hard
sudo -u www-data wp plugin install woocommerce --activate
sudo -u www-data wp plugin list --status=active
sudo -u www-data wp wc tool run install_pages --user=siteadminThe last command creates the Shop, Cart, Checkout and My account pages if the wizard did not. Pretty permalinks matter for product URLs and for the store REST API, so set them before adding products. Next, open https://example.net/wp-admin/ and work through the WooCommerce setup screens: store address, currency, product types, tax and shipping zones.
How do you make background jobs reliable?
WooCommerce schedules a lot of work: stock updates, order emails, webhooks and cleanups. By default WP-Cron only fires when someone visits the site, which is unreliable on a quiet shop. Switch it to system cron:
sudo -u www-data wp config set DISABLE_WP_CRON true --raw
sudo crontab -u www-data -e
# add this line:
*/2 * * * * cd /var/www/example.net && /usr/local/bin/wp cron event run --due-now --quietCheck the queue afterwards in WooCommerce, Status, Scheduled Actions, or from the shell with sudo -u www-data wp action-scheduler run to process anything pending. A growing list of past-due actions usually means cron is not running or a plugin job keeps failing.
How do order emails reach customers?
Send them through an authenticated SMTP relay on port 587 rather than from the server directly. Outgoing port 25 is not something to count on, so open a support ticket first if you ever plan to deliver mail straight from the VPS. With a relay, receipts and password resets land reliably and inherit the relay's reputation.
- Create SMTP credentials for
shop@example.netwith your mail provider. - Install an SMTP mail plugin and enter the host, port 587, STARTTLS, username and password.
- Add the SPF and DKIM records your relay gives you, as explained in the SPF, DKIM and DMARC guide.
- Place a test order and confirm both the customer and admin emails arrive.
Check that the relay port is reachable with nc -vz smtp.example.net 587. The SMTP relay guide has a full walk-through.
Which pages must never be cached?
Anything tied to one customer: the cart, checkout, My account, and any request carrying the cart cookie. If those get cached, one visitor can see another visitor's basket. In an Nginx FastCGI setup, add these to the skip rules:
if ($request_uri ~* "/cart|/checkout|/my-account|/wc-api|/\?add-to-cart=") { set $skip_cache 1; }
if ($http_cookie ~* "woocommerce_items_in_cart|wp_woocommerce_session_") { set $skip_cache 1; }A Redis object cache is safe and helps a lot here, because cart and checkout pages run many repeated queries. The WordPress caching guide shows the full cache setup that these lines plug into.
How do you secure the shop?
A store holds customer names, addresses and order history, so tighten the basics:
- Keep only SSH, HTTP and HTTPS open (
sudo ufw status) and use key-only SSH as in SSH keys and hardening. - Give staff the Shop manager role instead of Administrator.
- Add fail2ban with a filter for repeated wp-login failures.
- Use payment plugins that redirect to or embed the payment provider, so card data never touches your server.
- Update WooCommerce and its extensions weekly, after a backup.
How do you back up and update a store safely?
Orders change all day, so back up the database more often than on a blog, and test big updates on a copy first.
cd /var/www/example.net
sudo -u www-data wp db export /var/backups/wp/shop-$(date +%F-%H%M).sql --single-transaction
sudo -u www-data wp plugin update woocommerce
sudo -u www-data wp wc updatewp wc update runs any pending database migrations after a WooCommerce upgrade. For staging, restore last night's backup to staging.example.net and run wp search-replace as shown in the WordPress backup guide. Turn off outgoing email on staging so test orders do not mail real customers.
Plans that fit this guide
Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.
| Plan | Fits because | Size | Monthly | Order from |
|---|---|---|---|---|
| A2-4 | a small shop with Redis | 2 vCPU, 4 GB RAM, 100 GB NVMe | $14.40/mo | $43.20 for 3 months |
| A4-8 | larger catalogues and busier checkouts | 4 vCPU, 8 GB RAM, 180 GB NVMe | $28.80/mo | $86.40 for 3 months |
| F4-16 | NVMe and headroom for imports | 4 vCPU, 16 GB RAM, 384 GB NVMe | $57.60/mo | $57.60 for 1 month |
Questions about WooCommerce shop setup
How much RAM does a WooCommerce store need?
A small catalogue with a handful of extensions runs on 2 GB. Larger catalogues, many concurrent shoppers or heavy reporting are more comfortable with 4 GB and a Redis object cache.
Can I accept crypto payments in WooCommerce?
Yes, through payment plugins that connect to a crypto payment processor or to your own node. Pick one that keeps keys and invoices off the web server where possible.
Why are my order emails not arriving?
Usually the server tries to send directly and the mail is dropped. Configure an SMTP relay on port 587 with SPF and DKIM, then place a test order.
Do I need a dedicated IP for the shop?
Every instance already comes with its own IPv4 and IPv6 address, so the store has a dedicated IP from the start.
Should the shop run on the same server as my blog?
It can, but a separate instance keeps shop updates, load and security isolated from other sites. Small stores often start together and split later.
More in Websites, CMS and shops
- WordPress on Nginx, PHP-FPM, MariaDB
- Fix common WordPress errors
- Back up WordPress (3-2-1 rule)
- WordPress caching with Redis
- Ghost publishing platform
- Moodle learning platform
- phpBB forum
- Flarum forum
- Discourse community forum
- MediaWiki on Nginx and MariaDB
- Magento Open Source with OpenSearch
- PrestaShop store on Nginx
- OpenCart shop on Nginx
- Matomo web analytics
- Static site with Nginx and rsync
- Joomla on Nginx and PHP-FPM
- Drupal with Composer and Drush
- Vanilla Forums open source