There are many tutorials in the network of
how to install WordPress step by step
, but they are all installations from cPanel or installation guides through incomplete SSH that do not tell us how to create the database and associate it with a user with console commands. To solve all of the above, I have created this complete
guide on how to install WordPress from the SSH console
easily and easily.
Installing WordPress through the SSH shell
is a simple task, but it requires knowing some basic commands which I will try to explain briefly as we need them and I assume that we will use PuTTY and that you have the necessary knowledge to open an SSH session on your
How to install WordPress from the SSH console
Before starting, I assume that our server has Apache, MySQL and PHP installed. We must also bear in mind that we will install our WordPress in the directory
so our commands and examples this will be the reference directory.
Before starting we will need the following information:
Username and root password
(or another user with sufficient permissions)
to log in to the remote server through PuTTY.
MySQL root user and password.
1) Download the latest version of WordPress.
First of all we will use the
(it allows you to change the folder or directory)
to place us in our installation folder:
In this step we will use the
command to download the latest version of WordPress with SSH.
To download the latest version of WordPress in Spanish we go to:
Once inside the previous page we copy the link of the file with extension
, today the link corresponds to the WordPress version 3.8.1 and is
, which we use in the following command:
When downloading the latest version of WordPress in English it is easier, because the file name is always the same
, so the download URL never varies. With the following command we download the latest version of WordPress in English:
With this we already have the latest version of WordPress on our downloaded server
and depending on whether we want it in English or Spanish we will use one or another download link. In this guide I will install the Spanish version, so the file name downloaded and that I will use in the following steps will be
2) Unzip the WordPress files.
We already have the WordPress compressed package on the server but we need to unzip it. As we have downloaded the file with extension
we will use the following command to decompress:
tar -xzvf wordpress-3.8.1-es_ES.tar.gz
After executing this command, a
folder containing all the necessary files will be created, but we do not want to install WordPress inside that folder, so we have to move all the files from
. We achieve this by executing the following command:
mv ./wordpress/* ./
This command moves all the files inside the wordpress folder in the current folder.
Now we can delete the
folder since it is empty and is useless, for this we execute the command:
rm -rf ./wordpress
With this we already have the web installation accessible through the corresponding URL, in our case it would be:
But before proceeding with the installation we will see
how to create a database and assign a user, all this through SSH with different commands
3) Create MySQL user and database to install WordPress.
What we are going to do in this step is to create a user, who we will call him
and then we will create a database named
. Then we will assign to this database the
user giving him the necessary permissions. We will do this with SSH using the following commands:
We access MySQL as root:
mysql -u root -p
It will ask us to enter the MySQL password.
We create the MySQL username of
name and password
CREATE USER 'TechnoWikis'@'localhost' IDENTIFIED BY 'pn3Fh6Td';
We create the database
CREATE DATABASE TechnoWikis_blog;
We assign permissions to the user TechnoWikis on the database
GRANT ALL PRIVILEGES ON TechnoWikis_blog.* TO 'TechnoWikis'@'localhost';
We recharge privileges:
Now when the time comes for WordPress installation we already have the necessary data:
MySQL user password:
I hope this
guide on how to install WordPress from the SSH console has been helpful
. Step number 3 where I create the user and MySQL database I prefer to create a user for the blog because I see it more orderly, but whatever it is never to use your MySQL root user directly in the installation of WordPress since it is a bad practice of security.