This script automates the installation of WordPress on an Ubuntu server, including the setup of Apache, MariaDB, and PHP, as well as the creation of a WordPress database and user.
- A clean Ubuntu server
sudoor root access- A basic understanding of server administration
- Installs Apache2, MariaDB, PHP, and necessary PHP extensions
- Secures the MariaDB installation
- Creates a database and user for WordPress
- Downloads and installs the latest version of WordPress
- Configures
wp-config.phpwith secure database credentials - Adds WordPress security keys
- Configures the firewall to allow HTTP and HTTPS traffic
- Provides the WordPress installation URL, database name, username, and password
You can either create the script manually or download it using git:
git clone https://github.com/mojahid2021/Wordpress-install.git
chmod +x wp-install.sh
Run the script as root or using sudo:
sudo ./wp-install.sh
The script will prompt you to enter a domain name. If you do not provide one, the server's IP address will be used.
Once the script completes, you can access your WordPress site at:
http://<your-domain-or-ip>/
- The script will ask for your domain name. If left blank, it will use the server's IP address.
- The database user is created with the username
wp_userand a randomly generated password. - The script will display the credentials for your WordPress installation at the end.
- Make sure to replace the
your-server-ipwith your actual server IP or domain in the output message.
- If the script fails to run or there are errors, ensure that your server meets the prerequisites, such as having a fresh installation of Ubuntu.
- Ensure that your server has internet access for downloading the necessary packages and WordPress.
- If you encounter issues with MariaDB, check that the
mysql_secure_installationscript completes successfully.
This script is released under the MIT License.