Automated, production-ready WordPress installer for Ubuntu 24.04 LTS and Debian 13 (Trixie).
A single bash script that sets up a hardened, high-performance WordPress server from scratch in minutes. Interactive prompts guide you through every configuration option — no manual editing required.
Stack:
- Web server: Nginx + FastCGI cache (1 GB zone) + Brotli & Gzip compression
- PHP: PHP-FPM 8.1/8.2/8.3/8.4/8.5 (selectable) + OPcache JIT
- Database: MariaDB (tuned: 256 MB InnoDB buffer, slow query log)
- Object cache: Redis (128 MB LRU, object cache only)
- Security: UFW firewall + Fail2ban (SSH + Nginx + WordPress login jails)
- Cache management: Nginx Helper plugin (automatic FastCGI cache purge)
- CLI: WP-CLI with
wpclishortcut - SSL: Optional Let's Encrypt / Certbot (automatic HTTPS redirect)
- Backups: Daily MariaDB dumps with 7-day rotation
- Reverse Proxy mode: Auto-configures for NPM/Traefik/Cloudflare (Real-IP, HTTPS URLs, Fail2ban whitelist)
- phpMyAdmin: Optional, accessible via subdomain
phpmyadmin.domain - FileBrowser: Optional web file manager via subdomain
files.domain
- Ubuntu 24.04 LTS or Debian 13 (Trixie)
- Root / sudo access
- A domain name pointing to the server (required for SSL)
curl -fsSL https://raw.githubusercontent.com/djanzin/perfect-wordpress/main/install-wordpress.sh -o /tmp/install-wp.sh && sudo bash /tmp/install-wp.shWith flags (non-interactive):
curl -fsSL https://raw.githubusercontent.com/djanzin/perfect-wordpress/main/install-wordpress.sh -o /tmp/install-wp.sh && sudo bash /tmp/install-wp.sh --domain example.com --email admin@example.com --sslThe script will interactively ask for:
- Domain name & admin email
- Site title & admin username
- PHP version (8.1 / 8.2 / 8.3 / 8.4 / 8.5
⚠️ dev) - PHP memory limit (128M / 256M / 512M / 1024M)
- WordPress language (default:
de_DE) - Timezone (default:
Europe/Berlin) - SSL via Let's Encrypt (yes/no)
All options can be passed as flags to skip the interactive prompts:
sudo bash install-wordpress.sh \
--domain example.com \
--email admin@example.com \
--title "My Site" \
--admin-user admin \
--php 8.3 \
--memory 256M \
--lang en_US \
--timezone America/New_York \
--ssl| Flag | Description | Default |
|---|---|---|
--domain |
Domain name (e.g. example.com) |
— |
--email |
WordPress admin email | — |
--title |
WordPress site title | My WordPress Site |
--admin-user |
WordPress admin username | admin |
--php |
PHP version (8.1, 8.2, 8.3, 8.4, 8.5) |
8.3 |
--memory |
PHP memory limit (128M, 256M, 512M, 1024M) |
256M |
--lang |
WordPress language code | de_DE |
--timezone |
PHP/WordPress timezone | Europe/Berlin |
--ssl |
Install SSL certificate via Certbot | false |
--english |
English prompts and status messages | false |
- System update + base tools + swap file (auto-created if < 1 GB available)
- Nginx + FastCGI cache + Brotli compression + cache purge module
- PHP-FPM (selected version) + OPcache JIT (tracing mode, 128 MB JIT buffer)
- MariaDB (InnoDB optimized, slow query log, hardened)
- Redis object cache (128 MB LRU, no persistence)
- UFW firewall + Fail2ban (SSH, Nginx, WordPress login jails)
- WordPress core (latest) +
wp-config.php(randomized table prefix, secure salts) - WP-CLI + Redis Cache plugin + Nginx Helper plugin (auto-configured)
- Log rotation + system cron (replaces WP-Cron) + daily DB backups
All generated credentials (admin password, database, Redis) are saved to:
/root/.wp_install_credentials_<domain>.txt (chmod 600)
Database backups are stored in:
/root/backups/mysql/ (daily, 7-day rotation)
curl -fsSL https://raw.githubusercontent.com/djanzin/perfect-wordpress/main/update-wordpress.sh -o /tmp/update-wp.sh && sudo bash /tmp/update-wp.shWith flags:
sudo bash update-wordpress.sh --all # WordPress + Plugins + Themes + System + WP-CLI + SSL
sudo bash update-wordpress.sh # WordPress + Plugins + Themes + Cache only
sudo bash update-wordpress.sh --system # additionally: system packages
sudo bash update-wordpress.sh --wpcli # additionally: WP-CLI
sudo bash update-wordpress.sh --ssl # additionally: renew SSL certificate| Flag | Description |
|---|---|
--all |
Run all updates |
--system |
Update system packages via apt |
--wpcli |
Update WP-CLI to latest version |
--ssl |
Renew SSL certificate via Certbot |
--wp-path |
Custom WordPress path (auto-detected if omitted) |
--english |
English status messages |
Removes everything installed by this script — WordPress, Nginx, PHP-FPM, MariaDB, Redis, Fail2ban, WP-CLI, phpMyAdmin, FileBrowser, SSL certificates, cron jobs and swap. Runs without any prompts.
curl -fsSL https://raw.githubusercontent.com/djanzin/perfect-wordpress/main/reset-wordpress.sh -o /tmp/reset-wp.sh && sudo bash /tmp/reset-wp.shUse --english for English output:
sudo bash reset-wordpress.sh --englishWarning: This is irreversible. All data including the database and uploaded files will be permanently deleted.
Ein einzelnes Bash-Script, das einen abgesicherten, leistungsstarken WordPress-Server in wenigen Minuten von Grund auf einrichtet. Interaktive Abfragen führen durch alle Konfigurationsoptionen — kein manuelles Editieren nötig.
Stack:
- Webserver: Nginx + FastCGI-Cache (1 GB Zone) + Brotli & Gzip Komprimierung
- PHP: PHP-FPM 8.1/8.2/8.3/8.4 (wählbar) + OPcache JIT
- Datenbank: MariaDB (optimiert: 256 MB InnoDB Buffer, Slow Query Log)
- Object Cache: Redis (128 MB LRU, nur Cache)
- Sicherheit: UFW Firewall + Fail2ban (SSH + Nginx + WordPress-Login Jails)
- Cache-Verwaltung: Nginx Helper Plugin (automatische FastCGI-Cache-Invalidierung)
- CLI: WP-CLI mit
wpcliShortcut - SSL: Optionales Let's Encrypt / Certbot (automatischer HTTPS-Redirect)
- Backups: Tägliche MariaDB-Dumps mit 7-Tage-Rotation
- Reverse Proxy Modus: Automatische Konfiguration für NPM/Traefik/Cloudflare (Real-IP, HTTPS-URLs, Fail2ban Whitelist)
- phpMyAdmin: Optional, erreichbar über Subdomain
phpmyadmin.domain - FileBrowser: Optionaler Web-Dateimanager über Subdomain
files.domain
- Ubuntu 24.04 LTS oder Debian 13 (Trixie)
- Root / sudo Zugang
- Ein Domainname der auf den Server zeigt (erforderlich für SSL)
curl -fsSL https://raw.githubusercontent.com/djanzin/perfect-wordpress/main/install-wordpress.sh -o /tmp/install-wp.sh && sudo bash /tmp/install-wp.shMit Flags (nicht-interaktiv):
curl -fsSL https://raw.githubusercontent.com/djanzin/perfect-wordpress/main/install-wordpress.sh -o /tmp/install-wp.sh && sudo bash /tmp/install-wp.sh --domain example.com --email admin@example.com --sslDas Script fragt interaktiv nach:
- Domain & Admin-E-Mail
- Site-Titel & Admin-Benutzername
- PHP-Version (8.1 / 8.2 / 8.3 / 8.4)
- PHP Memory Limit (128M / 256M / 512M / 1024M)
- WordPress-Sprache (Standard:
de_DE) - Zeitzone (Standard:
Europe/Berlin) - SSL via Let's Encrypt (ja/nein)
Alle Optionen können als Flags übergeben werden, um die interaktiven Abfragen zu überspringen:
sudo bash install-wordpress.sh \
--domain example.com \
--email admin@example.com \
--title "Meine Seite" \
--admin-user admin \
--php 8.3 \
--memory 256M \
--lang de_DE \
--timezone Europe/Berlin \
--ssl| Flag | Beschreibung | Standard |
|---|---|---|
--domain |
Domainname (z.B. example.com) |
— |
--email |
WordPress Admin-E-Mail | — |
--title |
WordPress-Site-Titel | My WordPress Site |
--admin-user |
WordPress Admin-Benutzername | admin |
--php |
PHP-Version (8.1, 8.2, 8.3, 8.4) |
8.3 |
--memory |
PHP Memory Limit (128M, 256M, 512M, 1024M) |
256M |
--lang |
WordPress-Sprachcode | de_DE |
--timezone |
PHP/WordPress-Zeitzone | Europe/Berlin |
--ssl |
SSL-Zertifikat via Certbot installieren | false |
--english |
Englische Ausgabe für alle Prompts und Statusmeldungen | false |
- System-Update + Basis-Tools + Swap-Datei (automatisch angelegt falls < 1 GB vorhanden)
- Nginx + FastCGI-Cache + Brotli-Komprimierung + Cache-Purge-Modul
- PHP-FPM (gewählte Version) + OPcache JIT (Tracing-Modus, 128 MB JIT-Buffer)
- MariaDB (InnoDB optimiert, Slow Query Log, gehärtet)
- Redis Object Cache (128 MB LRU, keine Persistenz)
- UFW Firewall + Fail2ban (SSH-, Nginx- und WordPress-Login-Jails)
- WordPress Core (aktuell) +
wp-config.php(zufälliger Tabellen-Präfix, sichere Salts) - WP-CLI + Redis Cache Plugin + Nginx Helper Plugin (automatisch konfiguriert)
- Log-Rotation + System-Cron (ersetzt WP-Cron) + tägliche DB-Backups
Alle generierten Zugangsdaten (Admin-Passwort, Datenbank, Redis) werden gespeichert in:
/root/.wp_install_credentials_<domain>.txt (chmod 600)
Datenbank-Backups befinden sich in:
/root/backups/mysql/ (täglich, 7 Tage Rotation)
curl -fsSL https://raw.githubusercontent.com/djanzin/perfect-wordpress/main/update-wordpress.sh -o /tmp/update-wp.sh && sudo bash /tmp/update-wp.shMit Flags:
sudo bash update-wordpress.sh --all # WordPress + Plugins + Themes + System + WP-CLI + SSL
sudo bash update-wordpress.sh # Nur WordPress + Plugins + Themes + Cache
sudo bash update-wordpress.sh --system # Zusätzlich: System-Pakete
sudo bash update-wordpress.sh --wpcli # Zusätzlich: WP-CLI
sudo bash update-wordpress.sh --ssl # Zusätzlich: SSL-Zertifikat erneuern| Flag | Beschreibung |
|---|---|
--all |
Alle Updates ausführen |
--system |
System-Pakete via apt aktualisieren |
--wpcli |
WP-CLI auf neueste Version aktualisieren |
--ssl |
SSL-Zertifikat via Certbot erneuern |
--wp-path |
Eigener WordPress-Pfad (wird automatisch erkannt falls nicht angegeben) |
--english |
Englische Statusmeldungen |
Entfernt alles was dieses Script installiert hat — WordPress, Nginx, PHP-FPM, MariaDB, Redis, Fail2ban, WP-CLI, phpMyAdmin, FileBrowser, SSL-Zertifikate, Cron-Jobs und Swap. Läuft ohne Rückfragen durch.
curl -fsSL https://raw.githubusercontent.com/djanzin/perfect-wordpress/main/reset-wordpress.sh -o /tmp/reset-wp.sh && sudo bash /tmp/reset-wp.shMit --english für englische Ausgabe:
sudo bash reset-wordpress.sh --englishWarnung: Dieser Vorgang ist unwiderruflich. Alle Daten einschließlich Datenbank und hochgeladener Dateien werden dauerhaft gelöscht.
MIT