One-Command WordPress Installer for Debian Based OS's
Automate a clean, secure, production-ready WordPress site in minutes
Manually installing Nginx + MariaDB + PHP + WordPress is repetitive and a hassle if you miss something, especially late at night. That’s why I built 'setup-wp-v1.0.sh': a single, minimal, safe-to-re-run bash script that does everything for you on a fresh Debian based Linux server. You could also run this on your desktop or laptop to set up a local environment.
Why this script rocks
- Minimal footprint — only the packages you actually need
- Secure defaults — random 32-character DB password + fresh WordPress salts from the official API
- Sensible tuning — PHP upload limits raised to 64 MB, memory to 256 MB
- Proper permissions — www-data ownership, 755/644/640 modes
- Ready for HTTPS — optional official Certbot Snap installation for Ubuntu
- Repeatable — safe to run again for repairs or updates
- Perfect for homelab — works great behind your Nginx Proxy Manager (just point NPM to the internal IP:80 or 443)
Prerequisites
- Debian based Server or Desktop OS.
- Root or sudo privileges
- SSH access
- Internet connection
- ~500 MB free disk space
- (Optional but recommended) A domain name pointing to your server’s public IP
Pro tip: Run this in a dedicated Ubuntu VM so it stays isolated from your main Docker environment. This can also be used on services like Digital Ocean or other VPS providers.
Step 1: Download the Script
SSH into your server and run the following commands to download the script to your user directory or wherever you run the command from.
# Using wget (most common)
$ wget https://personal.laxtontx.com/tools/setup-wp-v1.0.sh -O setup-wp-v1.0.sh
# Or curl if you prefer $ curl -O https://personal.laxtontx.com/tools/setup-wp-v1.0.sh
Step 2: Run It
# Make it executable.
$ chmod +x setup-wp-v1.0.sh
# Then Run it. $ sudo ./setup-wp-v1.0.sh
Or
# Use sudo and call bash directly.
$ sudo bash setup-wp-v1.0.sh
The script is fully interactive and colorful. It will ask you three quick questions:
- WordPress directory name to create under /var/www/ (default: html)
- Domain or IP address (auto-detects your primary public IP or machine IP)
- Install official Certbot via Snap? (y/N) (If your on Ubuntu)
** If you're not on Ubuntu, than I recommend using your distro's instructions for installing Certbot if you need an SSL. You can find those here: https://certbot.eff.org/
Then it shows a clear summary before proceeding. If you're behind a proxy or just don't need an SSL and don't need Certbot, just say 'n' when asked and use your proxy to terminate the SSL and pass the connection to your host.
After the Script Finishes
- Open http://your-domain-or-ip in a browser → you’ll see the standard 5-minute WordPress setup screen.
- Finish the wizard (it pre-connects your database).
- If you chose to install certbot, change your domain to start with https://
- Enable HTTPS with the following command (if you chose Certbot):
sudo certbot --nginx -d yourdomain.com
Just want to see the script? Use the download command above
or just click here to save it and then open with a text editor.
What the Script Actually Does (Step-by-Step)
1. Minimal Package Installation
The script is extremely readable and broken into clear sections. Here are the key parts:
$ sudo apt-get install -y \
nginx mariadb-server \
php8.3-fpm php8.3-mysql php8.3-curl php8.3-gd \ php8.3-mbstring php8.3-xml php8.3-zip php8.3-intl \ php8.3-bcmath php8.3-imagick curl unzip
2. Secure Database Setup
Creates database 'wordpress' and user 'wp_user' with a strong random password (saved and displayed at the end).
3. PHP Tuning
upload_max_filesize=64M
post_max_size=64M
memory_limit=256M
4. Latest WordPress + Clean wp-config.php
Downloads official latest.tar.gz, extracts, then creates wp-config.php with real salts:
define( 'DB_NAME', 'wordpress' );
define( 'DB_USER', 'wp_user' );
define( 'DB_PASSWORD', 'your-super-strong-random-password' );
define( 'DB_HOST', 'localhost' );
$table_prefix = 'wp_';
define( 'WP_MEMORY_LIMIT', '256M' );
5. Perfect Permissions
chown -R www-data:www-data "${WP_PATH}"
find "${WP_PATH}" -type d -exec chmod 755 {} +
find "${WP_PATH}" -type f -exec chmod 644 {} +
chmod 640 "${WP_PATH}/wp-config.php"
6. Nginx Configuration
Replaces the default site with a clean WordPress-optimized block (pretty permalinks, PHP-FPM, security headers).
After the Script Finishes
- Open http://your-domain-or-ip in a browser → you’ll see the standard 5-minute WordPress setup screen.
- Finish the wizard (it pre-connects your database).
- If you chose to install certbot, change your domain to start with https://
- Enable HTTPS with the following command (if you chose Certbot):
sudo certbot --nginx -d yourdomain.com