There are 2 ways to install WorPress site via command line interface (cli) . To install, we need access via SSH (if you have your own VPS / Dedicated server)
- Using download link
cd /path/to/your-webserver-root-or-folder curl -O https://wordpress.org/latest.zip unzip latest.zip mv wordpress/* . rm -R wordpress/ rm latest.zip mv wp-config-sample.php wp-config.php
What was done:
cd – go to the folder where WordPress will be installed
curl.. – downlod wordpress package archive
unzip… – extract archive
mv.. – move archive files from folder wordpres to root folder
rm… – remove folder wordpress
rm… – remove latest.zip
mv – rename simple config to current config file.
2. Using GIT repository
So, to install WordPress from the command line, we need GIT. Actually that’s all. Let’s start:
Open ssh command line
Put in folder wich install wordpress.
git clone git://core.git.wordpress.org/ folder_name
folder_name – folder to install wordpres, like /var/www/html
… and remove .git
rm -rf .git/
All the latest version of WP downloaded. Now we set it up.
Before we begin we need to create a new MySQL database.
After creating the database, rename wp-config-sample.php → wp-config.php
Fill in the MySQL settings
Copy the content from https://api.wordpress.org/secret-key/1.1/salt/ and replace it in the right place in wp-config.php
We change $ table_prefix = “wp_” to our. For example, “prefix_”
We start the url with our site in the browser. A setup window should appear.
We go on points.
So we meet with two ways to install WordPress from the command line. Thanks for reading!