If you are spinning up a fresh VPS or a local WSL2 environment for WordPress development, you shouldn't be wasting 20 minutes copy-pasting apt-get commands from generic tutorials. Configuring Apache virtual hosts, hunting down PHP extensions, creating MySQL users, and fixing www-data permissions is a completely solved problem. It is mechanical work that should be automated.
That’s why I wrote ez_wp_setup. It is a zero-dependency Bash script that provisions a fully tuned LAMP stack and drops a production-ready WordPress core onto a fresh Ubuntu or Debian instance in under 60 seconds.
When you run the installer, it doesn't just install packages blindly. It configures the environment to the exact specifications WordPress actually needs to run without throwing permission errors or missing extension warnings later.
Here is the exact breakdown of the stack:
- Web Server: Installs Apache2, enables
mod_rewrite, and configuresAllowOverride Allso your pretty permalinks work out of the box. - PHP 8+: Pulls down the latest PHP version along with the specific extensions WordPress relies on (
curl,gd,mbstring,xml,zip,imagick). - Database Engine: You can choose between MariaDB (recommended for speed) or standard MySQL. It automatically creates a dedicated database, generates a secure user, and enforces
utf8mb4encoding. - WordPress Core & Config: Downloads the latest official WordPress release, unpacks it into
/var/www/html/, and automatically wires up thewp-config.phpfile with your new database credentials. - Security Salts: It pings the official WordPress API to generate fresh cryptographic salts and injects them directly into your config file.
- Permissions: Recursively locks down
/var/www/html/towww-data:www-data, ensuring you can upload media and install plugins without fighting directory ownership errors.
You need a fresh, clean environment (WSL2, Ubuntu, or Debian) and root privileges.
To install the recommended MariaDB stack, run a single command:
curl -sSL https://raw.githubusercontent.com/Evgenii-Zinner/ez_wp_setup/master/install_fresh_mariadb.sh -o setup.sh && chmod +x setup.sh && sudo ./setup.sh(If you strictly require MySQL, swap the URL to install_fresh_mysql.sh instead).
When the script finishes, it drops a clean summary box in your terminal with your database credentials and the local IP address to access the site.
If you are running this in WSL2, you can just open your Windows browser and navigate to http://localhost. You'll immediately see the famous 5-minute WordPress installation screen, except the database is already connected. Just pick a site title, set an admin password, and you are done.
The source code is fully open and MIT licensed. You can review exactly what the bash commands are doing on the GitHub repository.