Install (hardened) Wordpress on a fresh Amazon EC2 Server in under 5 minutes

This script installs a LAMP Server with secured MySQL server (mysql-secure-installation) and (optionally hardened) Wordpress on a fresh Amazon EC2 Server running the Amazon Linux AMI.


How do I get set up?

Copy all files from the repository to your system.

Launch a new Amazon EC2 Server Instance - choose Amazon Linux AMI

Script Configuration: edit the file and replace the values of SSH_KEY_PATH, HOSTS, LIVE_HOSTNAME, DB_USER and DB_PASS.

Install LAMP Server and Wordpress

using the shell, CD into the script directory and type

$ fab install

Afterwards your new Wordpress site is up and running on Amazon EC2 Elastic Cloud Server!

Open your browser, navigate to your Domain (public name from AWS or your own domain name, if you have connected it to an Elastic IP) and complete your Wordpress installation entering your site name and admin user. Install all plugins you want to use.

Optional - Wordpress hardening

after you installed additional plugins, you can easily harden your Wordpress by running $ fab hardening_wordpress


On most Linux systems, python is pre-installed. Fabric is required for remote execution ( To install fabric type $ pip install fabric

This script (install-wordpress-on-amazon-ec2) implements the installation steps from the following resources