How to install WordPress with command line? (2 ways)

0
(0)

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)

  1. Using download link

Open ssh-console using your favourite ssh-client (PuTTY, MobaXterm, SmarTTY, DamewareSSH Client etc.) and enter following commands:

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

cd folder_name

… and remove .git

rm -rf .git/

All the latest version of WP downloaded. Now we set it up.

wp-config
Before we begin we need to create a new MySQL database.
After creating the database, rename wp-config-sample.php → wp-config.php
Edit 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_”

Installation

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!

Similar Posts:

1,445

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top