Docs cipi.yml Web panel API MCP Guides Compare GitHub Telegram channel
  1. Home
  2. Guides
  3. WooCommerce on your own VPS, step by step
PHP, WordPress & e-commerce

WooCommerce on your own VPS, step by step

Host a WooCommerce shop on an Ubuntu VPS from zero, explained for beginners: an isolated app, the database, HTTPS, PHP limits for a shop, real cron for Action Scheduler, caching, frequent backups, a staging copy and security.

By Updated 4 min read

WooCommerce turns WordPress into a shop. A shop is more demanding than a blog: orders arrive all day, payment webhooks must never be missed, and losing a day of data means losing orders. This guide sets up a WooCommerce shop on your own server with Cipi, from an empty VPS to a protected, backed-up store, explaining each step.

What you'll build#

  • Visitorshttps://shop.example.com
  • Nginx + PHP-FPMisolated app "shop", its own PHP pool
  • WordPress + WooCommercefiles in /home/shop/htdocs
  • MariaDBdatabase "shop", its own user
  • Cron every minuteAction Scheduler: orders, e-mails, webhooks
  • BackupsDB every 30 min, everything nightly to S3

Key ideas, in plain words#

TermMeaning
Custom appHow Cipi hosts any PHP software that isn't Laravel: code in ~/htdocs, served by Nginx and PHP-FPM (docs)
PHP-FPM poolThe PHP processes that run your shop. Each app has its own, with its own limits
Action SchedulerThe queue WooCommerce uses for background tasks (e-mails, stock, webhooks, subscriptions)
WP-CronWordPress' built-in scheduler, triggered by visits. Not reliable for a shop
StagingA private copy of the shop where you try updates first

Before you start#

  • A VPS with Cipi installed (quickstart): 2 GB RAM or more.
  • A domain, with an A record for shop.example.com pointing at the server.
  • An account at an e-mail provider for order e-mails (SMTP credentials).

1. Create the app and its database#

bash
sudo cipi app create --custom --user=shop --domain=shop.example.com --php=8.4
sudo cipi db create --name=shop --app=shop

The first command creates a Linux user shop, the folder /home/shop/htdocs, a PHP pool and the Nginx site. The second creates the database shop with its own user and links it to the app. Save the database password from the output: it's shown once.

Check your plugins' PHP support before choosing the version. You can change it later with sudo cipi app edit shop --php=8.5.

2. Install WordPress#

Log in as the app user and download WordPress into the web folder:

bash
ssh shop@203.0.113.10          # password and key from the create summary
cd ~/htdocs && rm -f index.html
curl -sO https://wordpress.org/latest.tar.gz
tar xzf latest.tar.gz --strip-components=1 && rm latest.tar.gz

Prefer a graphical tool? Connect with SFTP (FileZilla, Transmit, Cyberduck) as shop and upload the files to htdocs.

3. HTTPS before anything else#

bash
sudo cipi ssl install shop
sudo cipi ssl force shop

The certificate is free (Let's Encrypt), covers every alias and renews itself. force redirects every http:// request to https://, which payment providers require.

Now open https://shop.example.com, run the WordPress installer (database shop, user shop, the saved password, host 127.0.0.1), then install WooCommerce from Plugins.

4. PHP limits for a shop#

Product imports, big carts and payment callbacks need more than WordPress' defaults. Put the settings in a cipi.yml at the root of htdocs (Nginx never serves it):

yaml
# /home/shop/htdocs/cipi.yml
version: 1
app:
  php: "8.4"
  ini:
    memory_limit: 512M
    max_execution_time: 120
    upload_max_filesize: 64M
    post_max_size: 64M
bash
sudo cipi yml plan shop && sudo cipi yml apply shop
sudo cipi app limits shop --fpm-max-children=12     # parallel PHP workers
SettingWhy a shop needs it
memory_limitWooCommerce with a page builder and a few plugins easily exceeds 256 MB
max_execution_timeCSV imports and report generation take time
Upload sizesProduct images and import files
fpm_max_childrenHow many shoppers PHP serves at once. Each child uses ~60–120 MB: 12 children ≈ 1.5 GB

5. A real cron for Action Scheduler#

Tell WordPress to stop running cron on page views. In wp-config.php, above "That's all, stop editing":

php
define('DISABLE_WP_CRON', true);

Then add a real cron as the app user (crontab -e):

text
* * * * * php ~/htdocs/wp-cron.php >/dev/null 2>&1

Check it: WooCommerce → Status → Scheduled Actions should show past-due actions going to zero.

6. Order e-mails that arrive#

Install an SMTP plugin (WP Mail SMTP, FluentSMTP…) and enter your provider's SMTP host, port 587 and credentials. Send a test e-mail from the plugin. Add your provider's SPF and DKIM records to your DNS.

7. Speed#

LayerWhat to do
PHPOPcache is on by default. Keep PHP current: Cipi patches it every night
Page cacheA plugin that writes static HTML (cart, checkout and account pages excluded)
ImagesServe WebP; the optional image-optimizers host package adds cwebp, jpegoptim, pngquant (sudo cipi package install image-optimizers)
CDNCloudflare in front (orange cloud) with SSL mode Full (strict)
DatabaseKeep wp_options autoload small; delete old transients

8. Backups that match your orders#

A shop changes every few minutes, so back up the database often and everything nightly, to another place:

bash
sudo cipi backup configure          # once: your S3-compatible bucket
sudo cipi backup profile add shop-db --scope=db --databases=shop --every=30m --keep=48 --dest=local
sudo cipi backup profile add shop-nightly --scope=all --cron='0 3 * * *' --keep-days=30 --dest=s3 --encrypt
sudo cipi backup verify
Step 1 of 4Every 30 min

A database-only backup every 30 minutes, kept for 24 hours: orders placed in the last half hour are the most you can lose.

At worst you lose 30 minutes of orders. Full guide: backups to S3.

9. A staging copy for updates#

Never update WooCommerce, the theme or payment plugins straight on the live shop.

bash
sudo cipi app create --custom --user=shopstg --domain=staging.shop.example.com --php=8.4
sudo cipi db create --name=shopstg --app=shopstg
sudo cipi basicauth enable shopstg
sudo cipi ssl install shopstg

Copy the files (rsync -a /home/shop/htdocs/ /home/shopstg/htdocs/ as root, then sudo cipi app fix-permissions shopstg), restore last night's dump into shopstg, change the database name, user and password in wp-config.php, and set WP_HOME and WP_SITEURL to the staging URL. Then turn off payment gateways (or switch them to test mode) and outgoing e-mail on staging.

10. Security#

ItemHow
HTTPS everywhereDone in step 3
Brute-force on /wp-login.phpfail2ban is on; add Cloudflare Access on /wp-admin for the team (guide)
File changessudo cipi scan shop finds known malware; run it after installing plugins
IsolationOther apps on the server can't read /home/shop
UpdatesPHP patched nightly by Cipi; WordPress, themes and plugins by you, after staging
AlertsBackup failures and server problems on Telegram or Slack (guide)

Troubleshooting#

SymptomLikely cause and fix
"Error establishing a database connection"Wrong DB credentials in wp-config.php, or host localhost instead of 127.0.0.1
White page or 502 after a plugin installPHP memory: raise memory_limit, check sudo cipi app logs shop --type=php
Uploads fail above 2 MBupload_max_filesize and post_max_size not applied: sudo cipi yml plan shop
Orders stuck "pending payment"Payment webhook blocked: the shop must be reachable over HTTPS; check the gateway's webhook log
Scheduled actions past dueReal cron missing: crontab -l as shop
Mixed-content warningsSite URLs still http://: update them in Settings → General

Questions

How big a server do I need?

For a small shop with up to a few hundred orders a day, 2 GB of RAM and 2 vCPU are comfortable. Large catalogues, many concurrent shoppers or heavy plugins need 4 GB or more. Watch cipi status and add RAM before CPU.

Can WooCommerce share the server with my Laravel apps?

Yes. Each app runs as its own Linux user with its own PHP pool and open_basedir, so a vulnerable plugin can't read the other apps' files.

Why disable WP-Cron?

WP-Cron only runs when someone visits the site. Orders, stock holds, subscription renewals and webhooks scheduled by Action Scheduler can wait or pile up. A real cron runs them every minute, whatever the traffic.

Which payment plugins work?

All of them: the server doesn't restrict outgoing HTTPS. Make sure the shop is on HTTPS (cipi ssl force) before you enable live payments, and keep test keys on staging.

How do I update plugins safely?

On the staging copy first, then on production right after a fresh database backup (cipi db backup shop). Cipi patches PHP itself every night; plugins and WordPress core are updated by you from the dashboard.

Does Cipi install a page cache like Varnish?

No. Use a WordPress page-cache plugin that writes static files, and keep the cart, checkout and account pages uncached (WooCommerce does this with good plugins out of the box).

What if the shop gets hacked?

Restore files and database from the last clean backup, rotate passwords (cipi db password shop), update every plugin, and run cipi scan shop. Backups every 30 minutes keep the loss small.

Can I send order e-mails from the server?

Send them through an SMTP or API provider (Postmark, Mailgun, SES, Brevo…) with an SMTP plugin. Direct mail from a VPS usually lands in spam, and many providers block port 25.

Try it on your own server

Free and open source. One command on a fresh Ubuntu 24.04 or 26.04 VPS.

wget -O - https://cipi.sh/setup.sh | bash
Read the quickstart