A robust bash script with a terminal-based UI that simplifies the installation and management of a complete WordPress stack, including NGINX, MySQL, PHP, phpMyAdmin, and SSL certificates via Certbot.
Created by Parham Fatemi
-
Complete WordPress Stack: Installs and configures all necessary components:
- NGINX web server
- MySQL/MariaDB database
- PHP with optimized settings
- phpMyAdmin database management
- WordPress latest version
- SSL certificates via Let's Encrypt (Certbot)
-
Smart Installation:
- Detects already installed components
- Completes partial installations
- Updates existing systems
-
Multiple Site Management:
- Create and manage multiple WordPress installations on a single server
- Configure wildcard or standard SSL certificates
- List and manage existing WordPress sites
-
User-Friendly Interface:
- Terminal-based UI with color-coded status indicators
- Clear progress reporting
- Detailed logging
-
Security-Focused:
- Secure MySQL installation
- Auto-generated strong passwords
- Proper file permissions
- Ubuntu 18.04+ or Debian-based system
- Sudo privileges
- Internet connection
- Domain name(s) configured with DNS pointing to your server
Install the WordPress Stack with a single command:
curl -sSL https://raw.githubusercontent.com/parhamfa/wordpress-stack-installer/main/wordpress-stack-setup.sh -o /tmp/wp-stack.sh && sudo bash /tmp/wp-stack.shThe script will guide you through the interactive setup process to customize your WordPress stack.
# Clone the repository
git clone https://github.com/parhamfa/wordpress-stack-installer.git
# Change to the directory
cd wordpress-stack-installer
# Make the script executable
chmod +x wordpress-stack-setup.sh
# Run the installer
sudo ./wordpress-stack-setup.shThe script provides an interactive menu-driven interface:
- Install Complete Stack - Installs and configures all components
- Create New WordPress Site - Sets up a new WordPress installation with a database
- Configure SSL for a Site - Adds SSL certificates (standard or wildcard)
- List Existing WordPress Sites - Shows all WordPress installations with details
- System Information - Displays server specifications and component versions
- Exit - Quits the script
When creating a new WordPress site, you'll need to provide:
- Domain name (e.g., example.com or blog.example.com)
- Installation path (default: /var/www/your-domain)
- Database name (auto-generated based on domain)
- Database username (auto-generated based on domain)
- Database password (auto-generated, can be customized)
After setup, the script will display all the necessary information to access your site.
The script supports two types of SSL certificates:
- Standard Certificate: Covers your domain and the www subdomain only
- Wildcard Certificate: Covers your domain and all subdomains (e.g., *.example.com)
Wildcard certificates require DNS validation, where you'll need to add a TXT record to your DNS configuration. The script will guide you through this process.
After running the installer, you can access:
- Your WordPress site:
http://your-domain.comorhttps://your-domain.com(if SSL is configured) - WordPress admin:
http://your-domain.com/wp-admin - phpMyAdmin:
http://pma.your-domain.com(if configured)
The script creates a detailed log file at /var/log/wp-stack-installer.log which can help diagnose issues.
Common issues:
- MySQL Password Issues: The root password is saved to
/root/.mysql_root_password - Permission Denied: Make sure the script is run with sudo privileges
- SSL Certificate Failed: Ensure your DNS records are properly configured
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Let's Encrypt for providing free SSL certificates
- WordPress community for creating such a versatile CMS
- NGINX, MySQL, and PHP communities for their excellent software
