English · Türkçe
Production-ready WordPress stacks for Coolify and plain Docker Compose: tuned PHP and OPcache, real upload limits, healthchecks, pinned images, WP-Cron in a worker, optional Redis object cache, and one-switch install of the FluxWP Panel.
| Stack | Web server | Database | Object cache | Good for |
|---|---|---|---|---|
mariadb |
Apache + mod_php | MariaDB 11.8 LTS | none | Small sites, closest to the stock Coolify template |
mysql |
Apache + mod_php | MySQL 8.4 LTS | none | Hosts or tools that expect MySQL |
mariadb-redis (default) |
Apache + mod_php | MariaDB 11.8 LTS | Redis 8.8 | WooCommerce, membership, busy admin. Also at the root: docker-compose.yaml (Coolify) and docker-compose.local.yaml + .env.example (plain Docker) |
nginx-fpm |
nginx 1.30 + PHP-FPM | MariaDB 11.8 LTS | Redis 8.8 | Most traffic per GB of RAM |
wpapi |
Apache + mod_php | MariaDB 11.8 LTS | Redis 8.8 | Same as mariadb-redis plus the WhatsApp API (flx-wpapi) in the same compose, already connected to WordPress. See WordPress + WhatsApp API |
Every stack comes twice:
coolify/<stack>/docker-compose.yaml: one short file to paste into Coolify. Secrets are generated by Coolify.compose/<stack>/: plain Docker Compose with a.env.example. Works on any server with Docker.
From Git (default stack): Projects › Add Resource › Public Repository › https://github.com/FluxWP/docker-wordpress, branch main, build pack Docker Compose, Base Directory /, Docker Compose Location /docker-compose.yaml. Coolify reads docker-compose.yaml (MariaDB + Redis) and generates a domain. This repository only changes when the Docker stack changes, so plugin and theme releases in FluxWP/FluxWP never redeploy your site. For a stricter setup, turn Automatic Deployment off and press Deploy yourself. Deploy.
For another stack from Git, set Docker Compose Location to /coolify/<stack>/docker-compose.yaml (for example /coolify/wpapi/docker-compose.yaml). Do not point Coolify at compose/<stack>/: those files are for plain Docker, have no SERVICE_URL_* variable, so Coolify finds no domain and no generated secrets.
These stacks briefly lived in
FluxWP/FluxWPunderdocker/. They are back here so plugin and theme updates do not redeploy Docker sites. The images (ghcr.io/fluxwp/wordpress:*) and their tags did not change; for an existing Coolify app pointing at the monorepo, only the repository, Base Directory (/) and Watch Paths (clear it) change.
Another stack, or without Git:
- Projects › Add Resource › Docker Compose Empty.
- Paste
coolify/<stack>/docker-compose.yamland Save. - Coolify generates a domain for the
wordpressservice (nginxfornginx-fpm); put your own there if you like. - Deploy. Open the domain: WordPress's own install screen asks for language, site name and admin (
WP_AUTO_INSTALLdefaults to false). Finish that screen right after the first deploy: until it is completed, whoever opens the address first creates the admin account, and new domains are found by scanners within minutes (certificate logs). If the site cannot be set up right away, useWP_AUTO_INSTALL=true. Then the worker installs unattended and the install screen is closed. FluxWP Panel (flx-setup) comes installed, and its setup wizard opens when you first log in. IfWP_ADMIN_PASSWORDis empty, the generated password is not written to the logs. Read it withdocker compose exec worker cat /run/flx-private/admin-password. Change the password after the first login, then delete the file:docker compose exec worker rm /run/flx-private/admin-password. - Optional, in Environment Variables:
WP_ADMIN_USER,WP_ADMIN_PASSWORD,WP_ADMIN_EMAIL: use this account instead of a generated password andadmin@<host>.WP_AUTO_INSTALL=true: the worker installs, and/wp-admin/install.phpand/wp-admin/setup-config.phpstay closed unless you also setWP_INSTALL_TOKEN(alphanumeric, for exampleopenssl rand -hex 24). Open/wp-admin/install.php?wp_install_token=...once; the query string is stored in the web server access log, so prefer theX-WP-Install-Tokenheader for anything but that first browser visit. UnsetWP_INSTALL_TOKENafter the install is finished, because a token passed in the query string can end up in the Apache access log.FLUXWP_SETUP=false: leaves FluxWP Panel (flx-setup) out.WP_LOCALE=tr_TR,WP_TIMEZONE=Europe/Istanbul,WP_TITLE, PHP limits (see below). Redeploy after changing them.
Quick start with the default stack (mariadb-redis):
git clone --depth 1 https://github.com/FluxWP/docker-wordpress.git fluxwp
cd fluxwp
cp .env.example .env
# set DB_PASSWORD, DB_ROOT_PASSWORD, REDIS_PASSWORD: openssl rand -base64 24
docker compose -f docker-compose.local.yaml up -dAnother stack:
cd fluxwp/compose/mariadb # or mysql, mariadb-redis, nginx-fpm
cp .env.example .env
# set DB_PASSWORD, DB_ROOT_PASSWORD (and REDIS_PASSWORD): openssl rand -base64 24
docker compose up -dThe site listens on http://localhost:8080 (HTTP_PORT). For production, put a reverse proxy with HTTPS in front (Caddy, Traefik, nginx). WordPress detects HTTPS from X-Forwarded-Proto, and the real visitor IP is read from X-Forwarded-For when the proxy is on a private network.
WP_AUTO_INSTALL defaults to false (WordPress's own install screen, open to whoever reaches the address first, so complete it right away). With WP_AUTO_INSTALL=true and WP_URL set, the first start installs WordPress. An empty WP_ADMIN_PASSWORD is saved only in /run/flx-private/admin-password (mode 0600, worker only):
docker compose exec worker cat /run/flx-private/admin-passwordChange the password after the first login, then delete the file:
docker compose exec worker rm /run/flx-private/admin-passwordThe wpapi stack is mariadb-redis plus FluxWP WhatsApp API (flx-wpapi, an Evolution API v2 compatible WhatsApp bridge) as a wpapi service. The other stacks are unchanged; use this one only when you want WhatsApp on the same server.
- One shared key.
WPAPI_KEYis the only secret you set. Thewpapicontainer reads it asFLXW_API_KEY, WordPress gets it asWPAPI_KEY. Coolify generates it; with plain Docker runopenssl rand -hex 32. - Internal network. WordPress talks to
http://wpapi:3000. The service publishes no port, so nothing from outside can reach it.FLXW_ALLOW_PRIVATE_URLS=1lets it call WordPress back for webhooks and media on the Docker network. - No manual connection. When Flux Mail is active, the FluxWP Docker mu-plugin adds a WhatsApp connection (type Flux WPAPI) with that address, key and instance name (
WPAPI_INSTANCE, defaultmain). If you change the key or the address, the connection is updated on the next request. - Same database. The bridge keeps its data in the stack's MariaDB (tables
flxw_*) and its settings in thewpapi-datavolume. Pairing a number: Flux Mail › Connections › the WhatsApp connection › add account › scan the QR (WhatsApp › Linked devices). - Optional:
WPAPI_MSG_KEEP_DAYS(message history, default 45) andWPAPI_PANEL=onfor the fallback panel (publish a port or proxy it yourself; first login needs the setup token fromdocker compose logs wpapi).
cd compose/wpapi
cp .env.example .env
# set DB_PASSWORD, DB_ROOT_PASSWORD, REDIS_PASSWORD, WPAPI_KEY
docker compose up -dCoolify: paste coolify/wpapi/docker-compose.yaml into Docker Compose Empty. The image is ghcr.io/fluxwp/wordpress:wpapi-node22 (built from FluxWP/whatsapp-api main, rebuilt daily). Baileys uses the unofficial WhatsApp Web protocol, so use a number you can afford to lose and avoid bulk messages.
The settings live in our images, so the compose files only hold services and environment variables:
| Image | Based on | Adds |
|---|---|---|
ghcr.io/fluxwp/wordpress:7.1-php8.4-apache |
wordpress:7.1-php8.4-apache |
PHP/OPcache settings, Apache hardening and real IP, wp-config-extra.php |
ghcr.io/fluxwp/wordpress:7.1-php8.4-fpm |
wordpress:7.1-php8.4-fpm |
Same, plus the PHP-FPM pool |
ghcr.io/fluxwp/wordpress:worker-php8.4 |
wordpress:cli-2.12-php8.4 |
The worker script |
ghcr.io/fluxwp/wordpress:nginx-1.30 |
nginx:1.30-alpine |
nginx config for WordPress |
ghcr.io/fluxwp/wordpress:wpapi-node22 |
node:22-alpine |
FluxWP WhatsApp API (flx-wpapi) |
ghcr.io/fluxwp/wordpress:realtime-bun1.4 |
oven/bun:1.4-alpine |
FluxWP Realtime WebSocket server |
They are built for amd64 and arm64 and rebuilt every day, so security fixes in PHP and the base OS reach you on the next pull. Each build also gets a dated tag (7.1-php8.4-apache-20261105) if you want to pin one. The build fails on a PHP release with known critical vulnerabilities.
To change a file without building your own image, mount yours over it, for example ./my.ini:/usr/local/etc/php/conf.d/zz-flux.ini:ro.
| Stock template | Here |
|---|---|
wordpress:latest, mariadb:11 |
Pinned: wordpress:7.1-php8.4-*, mariadb:11.8, mysql:8.4, redis:8.8-alpine, nginx:1.30-alpine. Patch updates arrive on pull, major/minor upgrades are your decision. |
| PHP defaults (2 MB uploads, 128 MB memory) | 128 MB uploads, 256 MB memory, 300 s execution, 5000 input vars, all from env |
| OPcache with image defaults | 256 MB, 30k files, 32 MB interned strings, JIT off (no gain for WordPress) |
| Healthcheck loads the home page every 2 s (PHP + DB on every probe) | Static file (Apache) or FPM ping through nginx every 15 s, with start_period |
depends_on without condition |
Waits for a healthy database and Redis |
| WP-Cron on page loads | DISABLE_WP_CRON + worker container runs due events every 60 s, so cron also runs on quiet sites |
| Install screen open after deploy | Same by default (complete it right after the deploy). WP_AUTO_INSTALL=true installs unattended and closes the install screen; the generated admin password is in a file only the worker can read |
| MariaDB defaults | utf8mb4, 256 MB buffer pool, skip-name-resolve, performance schema off (~100-400 MB RAM saved), MARIADB_AUTO_UPGRADE |
| - | PHP 8.4.27+ (PHP2Shell, CVE-2026-109618/109619, fixed) and session.upload_progress off (its confirmed exploit path) |
| - | DISALLOW_FILE_EDIT, no-new-privileges, no DB/Redis ports published, server tokens hidden, wp-config.php/readme.html/PHP in uploads blocked, real client IP behind the proxy |
All optional. In Coolify they are environment variables, with Compose they go into .env.
| Variable | Default | |
|---|---|---|
PHP_MEMORY_LIMIT |
256M |
Also WP_MEMORY_LIMIT |
PHP_UPLOAD_MAX_FILESIZE |
128M |
Largest single upload |
PHP_POST_MAX_SIZE |
128M |
Keep ≥ upload size |
PHP_MAX_EXECUTION_TIME |
300 |
Seconds |
PHP_OPCACHE_MEMORY |
256 |
MB |
PHP_TIMEZONE |
UTC |
PHP date.timezone |
APACHE_MAX_WORKERS |
20 |
Apache stacks: max processes (~64 MB each) |
PHP_FPM_MAX_CHILDREN |
10 |
nginx-fpm: max PHP workers (~64 MB each, keep ≥ 4) |
DB_BUFFER_POOL_SIZE |
256M |
~50% of the RAM you give the database |
DB_MAX_CONNECTIONS |
100 |
|
REDIS_MAXMEMORY |
128mb |
Cache only, no persistence, LRU eviction |
WP_URL, WP_TITLE, WP_ADMIN_USER, WP_ADMIN_PASSWORD, WP_ADMIN_EMAIL |
Automatic install (Coolify fills the URL). Empty password is generated | |
WP_URL_SYNC |
true |
The worker makes the database follow WP_URL when the domain changes (see Changing the domain). false turns it off |
WP_AUTO_INSTALL |
false |
true: install on first start without WP_ADMIN_EMAIL (e-mail admin@<host>) and close the install screen. false: use WordPress's own install screen; it is open to anyone until you complete it |
WP_INSTALL_TOKEN |
Alphanumeric token (max 128) that opens /wp-admin/install.php and /wp-admin/setup-config.php. Only matters with WP_AUTO_INSTALL=true; empty keeps them closed then. Unset it after the install is finished, because a token passed in the query string can end up in the Apache access log |
|
WP_LOCALE |
en_US |
Language installed on first setup, e.g. tr_TR |
WP_TIMEZONE |
UTC |
Site timezone on first setup |
FLUXWP_SETUP |
true |
Installs FluxWP Panel (flx-setup) and opens its wizard on the first wp-admin visit; false leaves it out |
FLUXWP_SETUP_URL |
Custom zip; must be https. Default is updater.fluxwp.com, then the GitHub release |
|
FLUXWP_SETUP_SHA256 |
Optional SHA-256 pin for the Flux Setup zip. Empty skips the pin | |
FLUXWP_SETUP_SIGNATURE |
A zip from updater.fluxwp.com or github.com/FluxWP is installed only when its Ed25519 release signature verifies (same key as FluxWP Panel uses for updates). off skips the check, for emergencies only. A custom FLUXWP_SETUP_URL elsewhere is not checked; pin it with FLUXWP_SETUP_SHA256 |
|
WP_CRON_INTERVAL |
60 |
Periodic cron fallback after each pass |
WP_BACKGROUND_POLL_INTERVAL |
2 |
Seconds between lightweight shared-file wake checks; no PHP boot while idle |
WP_BACKGROUND_WORKERS_PER_PLUGIN |
3 |
Concurrent registered Flux background batches per plugin |
WP_BACKGROUND_MAX_PROCESSES |
9 |
Site-wide ceiling for those active background batches |
WP_ENVIRONMENT_TYPE |
production |
|
WORDPRESS_TABLE_PREFIX |
wp_ |
Only before the first install |
Anything else: WORDPRESS_CONFIG_EXTRA (PHP appended to wp-config.php; keep the default require line in it) or a mounted copy of a file from config/.
worker runs wordpress:cli and does four things, all safe to repeat:
- Waits for the WordPress files and the database.
- On first start: installs WordPress when
WP_AUTO_INSTALL=true(default false, WordPress's own install screen; setWP_ADMIN_EMAILto choose the address, otherwiseadmin@<host>), the language, the Redis Object Cache plugin and its drop-in (Redis stacks), and FluxWP Panel (FLUXWP_SETUP, on by default). The zip is downloaded over HTTPS, size-capped, and installed only if its FluxWP release signature verifies (official sources) and it containsflx-setup/flx-setup.phpand no escaping paths. It is active as soon as WordPress is installed, and the first wp-admin visit opens its setup wizard. Language and FluxWP Panel are done once, so later changes in wp-admin stay. A generated admin password is stored at/run/flx-private/admin-password(mode0600, only the worker can read it), not in the logs. Read it withdocker compose exec worker cat /run/flx-private/admin-password. Change the password after the first login, then delete the file:docker compose exec worker rm /run/flx-private/admin-password. - Follows a domain change: when
WP_URL(Coolify's domain) differs from the address stored in WordPress, it updateshome/siteurland replaces the old address in the database once. See Changing the domain. - Runs due WP-Cron events on shared-volume wake signals (checked every 2 seconds by default), while retaining the
WP_CRON_INTERVALperiodic fallback. Idle checks do not start PHP or WordPress.
The shared library bundled in Flux Mail, Certificates and Backup runs independent jobs concurrently: default 3 per plugin, with a 9-job site-wide ceiling. Change WP_BACKGROUND_WORKERS_PER_PLUGIN and WP_BACKGROUND_MAX_PROCESSES in the Coolify Environment Variables panel or Compose .env, then recreate the worker. These are capacity controls, not a claim that every server can sustain nine heavy jobs. Resource locks, mailbox quotas and the single-backup rule still apply. Unregistered third-party cron handlers keep their normal execution path.
Fast wake requires the updated worker image and compatible library bundles; older combinations keep the 60-second cron fallback. Signals contain only due timestamps, never message bodies or recipients. A new ready job can start after a short wake/WordPress bootstrap delay when capacity is free; a busy pool, future schedule, transport quota or retry delay can still postpone it. Normal WordPress installations without Docker keep their native scheduler.
WP-CLI is available there too:
docker compose exec worker wp plugin list
docker compose exec worker wp search-replace 'http://old.test' 'https://new.example' --all-tableswp db cli/export/import use the MariaDB client of the cli image; on the mysql stack use the mysql container instead (see below).
Stacks with Redis (mariadb-redis, nginx-fpm, wpapi) have a small realtime service (~25 MB RAM). WordPress publishes short "this changed" signals to Redis; the realtime service passes them over WebSocket to the signed-in FluxWP panel and FluxApp, so inboxes, badges and notifications update at once instead of on the next poll. Signals carry no content: clients load the data from WordPress as before, with the same permissions.
It is optional. If the service is down or removed, or the secret is empty, clients keep polling; nothing else depends on it.
- Coolify: nothing to set. The secret is generated (
SERVICE_PASSWORD_64_REALTIME) and the service answers on the site's own domain at/flx-rt. If you change the WordPress domain on an Apache stack, set therealtimeservice's domain tohttps://<domain>/flx-rttoo. Onnginx-fpm, nginx serves/flx-rtitself. - Plain Docker: set
FLX_REALTIME_SECRET(openssl rand -hex 32).nginx-fpmserves/flx-rtitself. On the Apache stacks, route/flx-rt(WebSocket) in your reverse proxy to127.0.0.1:${REALTIME_PORT:-8081}and setFLX_REALTIME_URL=/flx-rt. - Check:
docker compose exec worker wp flx realtime statusandwp flx realtime test(WordPress → Redis → realtime). - Sign-in: clients get a 60 second, single-use ticket from WordPress and send it as the first WebSocket message (never in the URL). Logging out, role and password changes close the user's sockets.
- For package authors: the mu-plugin
flx-realtime.phphasflx_realtime_publish(),flx_realtime_online()and theflx_realtime_topicsfilter; see its header. - Visitors (signed out): the same server also serves site visitors, with tickets that carry only the topics WordPress listed (no user, no capabilities,
RT_MAX_VISITORSsockets at once, default 300).flx_realtime_visitor_ticket( array( 'chatbot.conv.42' ) )after you authenticated the visitor yourself, andflx_realtime_publish( $topic, $data, array( 'topic' => $topic ) )to reach exactly those sockets. Public topics (public.*, e.g. a live donation total) are listed with theflx_realtime_public_topicsfilter; anyone may then fetch a ticket fromPOST /wp-json/flx-realtime/v1/public-ticket{ "topics": [...] }(30 per minute per address). Public payloads must be fit for everyone to read. The Flux AI Chatbot widget uses this to show replies at once.
# database (MariaDB stacks)
docker compose exec -T mariadb sh -c 'mariadb-dump -uroot -p"$MARIADB_ROOT_PASSWORD" "$MARIADB_DATABASE"' > backup.sql
docker compose exec -T mariadb sh -c 'mariadb -uroot -p"$MARIADB_ROOT_PASSWORD" "$MARIADB_DATABASE"' < backup.sql
# database (mysql stack)
docker compose exec -T mysql sh -c 'mysqldump -uroot -p"$MYSQL_ROOT_PASSWORD" "$MYSQL_DATABASE"' > backup.sql
# files (wp-content)
docker compose exec worker tar -C /var/www/html -czf - wp-content > wp-content.tgzCoolify can also back up the database service on a schedule.
Change the domain in Coolify (or WP_URL in .env) and redeploy. Nothing else is needed: when the worker starts it compares WP_URL with the home/siteurl stored in WordPress. If they differ it
- logs
site address changed: <old> -> <new>, - replaces the old address with the new one in every table with
wp search-replace(serialized data stays valid, theguidcolumn is skipped, JSON-escaped copies in block content are included), - flushes the object cache and stores the new address in the
flx_docker_urloption, so it runs once per change.
Follow it with docker compose logs worker (Coolify: the worker service logs). A change made by hand in wp-admin is not undone on later restarts, because the worker only reacts when WP_URL itself changes. Set WP_URL_SYNC=false to turn this off. A WP_URL with a path (https://example.com/blog) is not synced; use the manual steps.
If the site still redirects to the old domain, check, in this order:
docker compose logs workershows nosite address sync failed.WP_HOME/WP_SITEURLinWORDPRESS_CONFIG_EXTRAorwp-config.phpoverride the database. The worker warns about them; remove or update them.- A redirect or caching plugin still stores the old address. Purge its cache.
- Cloudflare or another proxy points at the new domain and its SSL mode is Full (strict).
Manual fix. The cli image already has WP-CLI, so use the worker:
docker compose exec worker wp option update home 'https://new.example'
docker compose exec worker wp option update siteurl 'https://new.example'
docker compose exec worker wp search-replace 'https://old.example' 'https://new.example' --all-tables --skip-columns=guid
docker compose exec worker wp cache flushIn Coolify open the worker service's Terminal instead of docker compose exec worker. If you are inside the wordpress container, it has no WP-CLI (wp: command not found). Download it once, it lives only until the next redeploy:
cd /tmp
curl -fsSLO https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --allow-root --path=/var/www/html option update home 'https://new.example'
php wp-cli.phar --allow-root --path=/var/www/html option update siteurl 'https://new.example'
php wp-cli.phar --allow-root --path=/var/www/html search-replace 'https://old.example' 'https://new.example' --all-tables --skip-columns=guid
php wp-cli.phar --allow-root --path=/var/www/html cache flushTake a database backup first (above). Add --dry-run to the search-replace to see the counts before changing anything.
- WordPress core, plugins, themes: from wp-admin as usual (minor core updates are automatic). The image tag only sets the PHP version and the files of a fresh install.
- Images: redeploy (Coolify) or
docker compose pull && docker compose up -dto get the latest daily build. New PHP or WordPress branches come as new tags. - MariaDB:
MARIADB_AUTO_UPGRADE=1runs the upgrade step when you move to a newer tag. Take a backup first.
config/,scripts/: files baked into the images (images/*/Dockerfile).tools/build.py: image tags and compose generator.
python3 tools/build.py # regenerate coolify/* and compose/*
python3 tools/build.py --check # what CI runs
docker build -f images/wordpress/Dockerfile --build-arg BASE=wordpress:7.1-php8.4-apache -t ghcr.io/fluxwp/wordpress:7.1-php8.4-apache .Run these from the repository root. Edit the sources, never the generated compose files. CI (.github/workflows/validate.yaml) builds the images from the pull request and runs every stack; .github/workflows/images.yaml publishes ghcr.io/fluxwp/wordpress (amd64 + arm64) on every push to main that touches the images, config or scripts, and daily for upstream security fixes.
FluxWP Docker is led and maintained by Ahmet Yılmaz (@sharkpaw).
![]() Ahmet Yılmaz Project lead · Maintainer |
Issues and pull requests are welcome. Contributors will be listed here.
MIT. WordPress and the images used here have their own licenses.
