These steps assume that wp-cli is installed and a database has been created.
1 2 3 4 5 6 7 8 9 10 11 |
cd /var/www/vhosts/example.com/httpdocs wp core download wp core config --dbname=wordpress \ --dbuser=user \ --dbpass=password \ --dbhost=localhost wp core install --url="http://example.com" \ --title="Blog Title" --admin_user="adminuser" \ --admin_password="password" \ --admin_email="email@example.com" |
Here’s a prompted version:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
read -p "Enter domain: " WPDOMAIN && \ read -p "Enter user: " WPUSER && \ read -p "Enter pass: " WPPASS && \ read -p "Enter email: " WPEMAIL && \ read -p "Enter DB host: " DBHOST && \ read -p "Enter DB name: " DBNAME && \ read -p "Enter DB user: " DBUSER && \ read -p "Enter DB pass: " DBPASS && \ echo "$DBHOST $DBNAME $DBUSER $DBPASS $WPDOMAIN $WPUSER $WPPASS $WPEMAIL" && \ wp core download && \ wp core config --dbname=$DBNAME \ --dbuser=$DBUSER \ --dbpass=$DBPASS \ --dbhost=$DBHOST && \ wp core install --url="$WPDOMAIN" \ --title="$WPDOMAIN" \ --admin_user="$WPUSER" \ --admin_password="$WPPASS" \ --admin_email="$WPEMAIL" |