Run WooCommerce as two persistent Docker services: a WordPress container and a separate MySQL 8.0+ or MariaDB 10.6+ container on a private Compose network. Put the WordPress service behind HTTPS, keep the database unpublished, store credentials as Docker secrets, and back up both the database and wp-content. This layout is easy to reproduce on a VPS while preserving the data WooCommerce needs for products, orders, settings, themes, extensions, and uploads.
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
Before deploying, verify WooCommerce’s current baseline: WordPress 6.9 or newer, PHP 8.3 or newer, MySQL 8.0 or newer (or MariaDB 10.6 or newer), HTTPS, and at least 256 MB of WordPress memory. Apache or Nginx is recommended.
As an Amazon Associate I earn from qualifying purchases.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
What the production stack contains
Docker Compose does not turn a VPS into a managed WooCommerce platform; it gives you a repeatable way to run and update the application. You remain responsible for operating-system updates, Docker security, DNS, TLS certificates, backups, monitoring, and recovery.
| Component | Role | Production rule |
|---|---|---|
| WordPress container | Runs WordPress, WooCommerce, PHP, and the web server | Use a pinned official image tag and persistent storage for /var/www/html |
| MySQL or MariaDB container | Stores products, orders, settings, posts, users, and WooCommerce tables | Attach only to the private database network; publish no host port |
| Compose networks | Provide service-to-service DNS and isolate the database | WordPress joins the web and database networks; the database joins only the database network |
| Named volumes | Keep files and database data when containers are recreated | Back up both volumes; a running container is not a backup |
| Reverse proxy | Accepts public HTTP(S), manages certificates, and forwards requests | Send the original HTTPS protocol to WordPress |
The official WordPress Compose pattern starts with docker compose up -d. The first initialization can take a couple of minutes while the database and WordPress files are prepared.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
Check requirements and plan the VPS
Software requirements
- WordPress 6.9 or later.
- PHP 8.3 or later, supplied by the selected WordPress image.
- MySQL 8.0 or later, or MariaDB 10.6 or later.
- HTTPS for the entire storefront, including login, account, cart, checkout, and payment callbacks.
- A WordPress memory limit of at least 256 MB.
- A supported Linux VPS, Docker Engine, and the Docker Compose plugin.
Capacity is workload-dependent
There is no universal CPU, RAM, disk, traffic, or monthly-cost figure that fits every WooCommerce store. Catalog size, concurrent shoppers, image processing, scheduled actions, search, payment callbacks, and backup retention determine the requirement. Start with a VPS appropriate to your expected workload, then monitor CPU, memory, disk space, database growth, PHP errors, and response time. Increase resources before swap activity or a full disk causes checkout failures.
Network and account preparation
- Create a non-root deployment account and give it the Docker permissions it needs. Keep root access for administration rather than daily Compose commands.
- Point an A record and, if used, an AAAA record for the store hostname to the VPS address.
- Allow only SSH and the web ports at the VPS firewall. Do not open MySQL’s port to the internet.
- Install Docker Engine and the Compose plugin from the distribution’s supported packages, then verify with
docker versionanddocker compose version. - Create a project directory such as
/srv/woocommerceowned by the deployment account.
Create a secure base Compose file
The following file uses the Apache variant of the official WordPress image. It keeps the database on an internal network, uses named volumes, and reads passwords from files rather than committing plaintext credentials to the Compose file.
services:
db:
image: mysql:8.0
restart: unless-stopped
environment:
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD_FILE: /run/secrets/db_password
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
volumes:
- db_data:/var/lib/mysql
secrets:
- db_password
- db_root_password
networks:
- backend
wordpress:
image: wordpress:6.9-apache
restart: unless-stopped
depends_on:
- db
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD_FILE: /run/secrets/db_password
volumes:
- wordpress_data:/var/www/html
expose:
- "80"
secrets:
- db_password
networks:
- frontend
- backend
volumes:
wordpress_data:
db_data:
networks:
frontend:
backend:
internal: true
secrets:
db_password:
file: ./secrets/db_password
db_root_password:
file: ./secrets/db_root_password
Create the secret files
- Make a directory that is readable only by the deployment account:
mkdir -p secrets && chmod 700 secrets. - Put a long, unique database-user password in
secrets/db_passwordand a different root password insecrets/db_root_password. - Set restrictive permissions, for example
chmod 600 secrets/*, and exclude the directory from version control and off-site configuration repositories that should not contain secrets. - Save the file as
compose.yamland validate it withdocker compose config. Fix every validation error before starting the stack.
The db hostname is resolved inside the Compose network; it is not a public DNS name. Do not add a ports entry to the database service. Publishing 3306 would create an unnecessary internet-facing attack surface.
Apache versus PHP-FPM
The Apache image is the simpler choice because it serves HTTP itself. A wordpress:<version>-fpm image is also possible, but it must sit behind a reverse proxy that speaks FastCGI. The FPM container must never be exposed directly to the internet.
| Choice | Advantages | Responsibilities and risks |
|---|---|---|
| Apache WordPress image | Fewer moving parts; proxy can forward ordinary HTTP | Apache and PHP settings are managed inside the image and proxy |
| PHP-FPM WordPress image | Separates web serving from PHP and fits an existing FastCGI proxy | Requires correct FastCGI configuration; direct exposure is unsafe |
Keep production changes in an override file
A base file can remain useful for staging while production-specific bindings and policies live in compose.production.yaml. For a host-level reverse proxy, add a loopback-only binding and explicit logging:
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
services:
wordpress:
ports:
- "127.0.0.1:8080:80"
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "10m"
max-file: "5"
db:
restart: unless-stopped
Start the merged configuration exactly as follows:
docker compose -f compose.yaml -f compose.production.yaml up -d
Only the reverse proxy can reach port 8080 from the host. If your proxy is another Compose service, attach it to the frontend network and proxy to http://wordpress:80 instead; you do not need a host port in that arrangement.
Pin and review image versions
Record the WordPress, PHP, and database tags you deploy. Validate upgrades in a staging project, then change the tags deliberately. Rebuild and redeploy regularly for security updates rather than relying on an unexamined latest tag. Keep the previous image tag and a tested database restore path available for rollback.
Start WordPress and install WooCommerce
- From the project directory, run
docker compose up -dfor a single-file test or the two-file production command above. - Check startup with
docker compose psand inspect messages withdocker compose logs -f wordpress db. Wait for the initial database setup to finish. - Open the hostname in a browser. Complete the WordPress installer using the final site administrator account.
- In WordPress administration, install and activate WooCommerce, then complete store location, currency, tax, shipping, and payment settings.
- Configure readable permalinks and create a test product. Test a full cart and checkout flow before accepting real orders.
- After HTTPS is active, set both WordPress Address (URL) and Site Address (URL) to the final
https://address. Do not leave one URL on HTTP.
Set the memory limit
Confirm that WordPress can use at least 256 MB. If the image or host does not already provide that value, add this line to wp-config.php before the line that says WordPress should stop editing:
define( 'WP_MEMORY_LIMIT', '256M' );
Check the effective value in the WordPress Site Health screen and after major plugin changes. A PHP process limit that is lower than WordPress’s setting can still cap real usage.
Put the store behind HTTPS
Terminate TLS at a reverse proxy
Use Nginx, Apache, Caddy, Traefik, or another maintained proxy to obtain and renew the certificate. The proxy should forward the host, client address, and original protocol. A minimal Nginx-style HTTP forwarding block looks like this:
Recommended Free Tools
Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
server {
listen 443 ssl;
server_name shop.example.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
}
Use your proxy’s certificate and renewal configuration, and add an HTTP-to-HTTPS redirect. The exact certificate paths and renewal commands depend on the proxy and Linux distribution.
Tell WordPress that the original request was HTTPS
When TLS ends before the WordPress container, add this check to wp-config.php so WordPress and WooCommerce do not treat secure requests as HTTP:
if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO'] ) {
$_SERVER['HTTPS'] = 'on';
}
Only trust this header from your own proxy network; do not allow arbitrary clients to assert it. Once the certificate is installed, clear caches and test login, cart, checkout, account pages, webhooks, and payment callbacks. WooCommerce strongly recommends SSL because checkout and account traffic is sensitive and most payment gateways require it.
Back up files and database data
WooCommerce data lives in two places: wp-content contains themes, extensions, and uploaded media; the database contains products, orders, settings, posts, pages, users, and other tables. A WordPress XML export does not replace a database backup.
Free tools Windows power users keep installed
One-click scans. No signup required.
Export the database
With the service running and the secret mounted, create a dated dump outside the container:
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
mkdir -p backups
docker compose exec -T db sh -c 'MYSQL_PWD="$(cat /run/secrets/db_password)" mysqldump -u wordpress wordpress' > "backups/db-$(date +%F).sql"
Use a consistent naming scheme, copy dumps off the VPS, and retain multiple restore points. A dump that remains only on the same disk as the live database does not protect against disk loss.
Copy WordPress content
Copy the persistent content directory to the backup location:
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesdocker compose cp wordpress:/var/www/html/wp-content "backups/wp-content-$(date +%F)"
Include themes, plugins, uploads, and any custom files your deployment uses. Protect backup storage as carefully as production storage because uploads and configuration can contain private information.
Automate and test restores
- Schedule database dumps and file copies rather than relying on manual memory.
- Keep copies on a different host or storage system, with retention that covers your business’s recovery needs.
- Restore into a separate Compose project on a non-public hostname at regular intervals.
- Verify that products, orders, media, users, scheduled actions, email, and payment callbacks work after restoration.
A WooCommerce-aware managed backup service can provide scheduled backups, activity logs, and one-click restores; confirm its current availability, retention, geography, and terms before relying on it. Whether backups are self-managed or managed, perform an actual restore drill.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Operate the stack without deleting data
Routine inspection
docker compose ps
docker compose logs -f wordpress
docker compose logs -f db
docker compose config
Use the merged -f options for every production command so you inspect and operate the same configuration that is deployed.
Best Value
Rebuild one service
For a targeted rebuild, Docker documents the pattern below. Substitute your actual service name:
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →docker compose build wordpress
docker compose up --no-deps -d wordpress
For image updates, pull and recreate during a maintenance window after testing the new tag. Then verify checkout, scheduled actions, email, webhooks, and payment callbacks.
Understand the two shutdown commands
docker compose down removes containers and networks but preserves named volumes, including the database volume. docker compose down --volumes also removes those volumes and therefore deletes the database data. Never use the volume-removing form as a routine restart. Take and verify backups before any destructive maintenance.
Update safely and keep a rollback path
- Take a fresh database dump and a fresh
wp-contentbackup. - Record the active image tags, Compose files, secret names, proxy configuration, and DNS settings.
- Clone the stack into staging and test the WordPress, PHP, database, plugin, and theme update there.
- Schedule a production maintenance window and announce possible checkout interruption.
- Apply one logical change at a time, watching logs and resource usage.
- Run a real test order or gateway sandbox transaction, then check email, webhooks, scheduled actions, customer login, refunds, and admin screens.
- If the release fails, restore the prior image tag and database backup according to the tested procedure. Do not attempt a rollback without checking database compatibility.
Choose implementation options deliberately
| Decision | Option A | Option B | What to evaluate |
|---|---|---|---|
| Web image | Apache WordPress image | PHP-FPM behind a proxy | Configuration complexity, FastCGI expertise, and where access logs and TLS are handled |
| Database | MySQL 8.0+ | MariaDB 10.6+ | Plugin compatibility, upgrade path, backup tooling, and your team’s database experience |
| TLS | Dedicated reverse proxy | TLS on the web container | Certificate renewal, header handling, isolation, and whether other services share the proxy |
| Compose layout | One file | Base plus production override | Reproducibility, reviewability, and separation of staging and production values |
| Backups | Scripts and off-host storage you operate | WooCommerce-aware managed service | Restore time, retention, audit logs, access controls, and vendor dependence |
| Hosting responsibility | Self-managed VPS | WooCommerce hosting partner or agency | Who handles patching, monitoring, incident response, scaling, and recovery |
Compare these choices by operational ownership, update process, observability, recovery time, and security boundaries rather than by an assumed universal performance number.
Troubleshoot common failures
WordPress reports that it cannot connect to the database
- Confirm both services are running with
docker compose ps. - Check that
WORDPRESS_DB_HOSTisdb:3306, notlocalhost. - Verify the database name, user, and secret file match on both services.
- Read
docker compose logs dbfor first-initialization errors. Changing database credentials after the data volume is initialized does not automatically rewrite existing users.
The browser shows an HTTPS redirect loop
Check that the proxy sends X-Forwarded-Proto: https, that the wp-config.php forwarded-protocol block is present, and that both WordPress URLs use HTTPS. Clear page-cache and proxy-cache entries after correcting the setting.
The proxy returns 502 or cannot reach WordPress
For a host proxy, verify the production binding is listening on 127.0.0.1:8080. For a proxy container, verify both services share the frontend network and that the proxy target is wordpress:80. An FPM image requires FastCGI rather than an HTTP proxy_pass.
Uploads fail or images disappear
Confirm that wordpress_data is mounted at /var/www/html, disk space is available, and the web process can write to wp-content/uploads. If files were restored manually, correct ownership inside the container and test a new upload.
Orders are missing after a restart
Check whether someone ran docker compose down --volumes or changed the Compose project name, which can create a different volume. Stop further changes, locate the original volume with docker volume ls, and restore the database and content from the latest verified backups if necessary.
Quick Recap
Go-live checklist
- WooCommerce requirements are met: WordPress 6.9+, PHP 8.3+, MySQL 8.0+ or MariaDB 10.6+, HTTPS, and 256 MB or more of WordPress memory.
- The database has no public port and is reachable only on the private Compose network.
- Production bindings, restart policies, and logging are in the production override file.
- Image tags are recorded and have been tested in staging.
- HTTP redirects to HTTPS, forwarded headers are configured, and both WordPress URLs use HTTPS.
- A test product, checkout, account login, email, webhook, and payment callback have succeeded.
- Database and
wp-contentbackups run automatically, are stored off-host, and have been restored in a drill. - The team knows the difference between
docker compose downanddocker compose down --volumes.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




