How to Install WordPress Through SSH, CPanel, Plesk, FTP or Github

The WordPress platform is actually very simple to install to a Linux web hosting account. However, installation of the WordPress platform will differ based on the options that are provided with your hosting account. For example, some hosting accounts will utilize the CPanel administrative application for managing your hosting account.

CPanel often includes software that will make installing WordPress, as well as other web platforms, simple and straightforward. Other web hosting companies may employ Plesk for the management of hosting accounts. Plesk, as with CPanel, provides options for easy installation for the WordPress platform.

How to Install WordPress Through SSH, CPanel, Plesk, FTP or Github

Prerequisites for WordPress Installation

SSH

Some web hosting companies may offer hosting account administrators Secure Shell, or “SSH,” access. The WordPress platform may also be installed using SSH commands. SSH is a command line driving program that allows users to interact remotely with the server from their Windows, Mac or Linux machines. If users access the web server from a Linux-based or Mac machine, SSH is ready to go. SSH is installed by default in these operating systems. For Windows users, however, they will need to download and install an application, such as PuTTY, that will allow them to “talk” to the SSH application on the web server.

FTP

The WordPress platform may also be installed using FTP. To install WordPress via FTP, the user will need an FTP program installed and configured on their remote computer. Ensure that the FTP client is configured to connect to the correct web server.

Github

Github is a hosted version controlled environment for developers. Those who need version control for code will use Github to store versioned code, and then will utilize a program such as SVN to interact with the repository.

WordPress may be installed directly from a Github repository directory. For Github, the user will need to have an active account on the Github repository and they will need to have the version of WordPress that they want to use, unzipped, within a specified repository directory.

CPanel and Plesk

The only prerequisite for installing WordPress from CPanel or Plesk is to simply ensure that there is enough space to accommodate the installation and the WordPress database within the user’s account. Additionally, the user will need to identify the application that will auto-install the WordPress platform. CPanel will often utilize Fantasico or Softaculos. Plesk utilizes an installation system known as the “Application Vault.”

Instructions for each method of installation are provided below. No matter the method you choose, WordPress installation is generally straightforward and simple.

Install WordPress Through Secure Shell (SSH)

First, you need to make sure that your web hosting company has SSH running and that you are allowed access to it. If you are unsure about your web hosting company’s SSH installation or access policy, call or create a ticket for their technical support. If installed and your account is able to access SSH, you are ready to install WordPress through an SSH connection.

You will need to be familiar enough with your web hosting account directory to know where to find the HTML, the public WWW directory. The WordPress platform will be installed within this public directory.

Step 1 - Access SSH
If you are working with a Linux-based system or a Mac, open the SSH application. If working on a Windows-based system, open the PuTTY application. Log into your web hosting account through the client program.

Step 2 - Change directories to your public HTML directory
From within SSH, change directories to the public HTML directory where WordPress will be installed. For example, type each of the commands below followed by the “Enter” key:

cd mydomain.com
cd html

...where mydomain.com is the root directory of your domain name. Note that the path to your public HTML directory will vary between web hosting companies. If you need assistance, call your web host’s support line for help.

Step 3 - Download the latest version of WordPress with WGet.
Type the following command at the SSH command prompt and press the “Enter” key. The latest compressed installation file of WordPress will download.

wget http://wordpress.org/latest.tar.gz

Step 4 - Uncompress the installation package
Type the following command at the SSH prompt.

tar xfz latest.tar.gz

The WordPress platform files will unzip into a directory named "WordPress".

Step 5 - Move the WordPress platform files back up one directory level
To move the files, type each command below and press the “Enter” key after each command.

cd wordpress/
cp -rpf * ../
cd ..

Step 6 - Delete the installation files
Run the following commands to delete the installation files and the directory created during the download process.

rm -rf ./wordpress/
rm -f latest.tar.gz

Next, you will need to create the backend database for the WordPress installation from within SSH.

Create the WordPress Database using SSH

Note that you will need root credentials to log into the server using SSH. If you do not have root privileges, you should create the database through CPanel or using the PHPAdmin application.

Step 1
Open the SSH client on your machine.

Step 2
Type the following command at the SSH command prompt. Replace the name “databasehostserver” with the name of the host server of your MySQL database application.

$ssh databasehostserver

Step 3
Log into MySQL as “root” on the database server using the following command:

mysql -u root -p

You will now see the mysql > prompt.

Step 4
Once logged into MySQL as root, create the database by typing the following command at the mysql > prompt. Replace newdatabase with the name of your new database.

CREATE DATABASE newdatabase

Step 5
Add a new user for the WordPress application by running the command below. Replace the newwpusername with the user name of the account you will use to enable WordPress access. Change the newpassword entry to the password for the new user.

GRANT ALL PRIVILEGES ON *.* TO 'newwpusername'@'localhost' IDENTIFIED BY 'newpassword';

The WordPress database and user are now created. Next, you will edit the wp-config.php file by inserting the new database name, user and password into the file. Finally, you will run the install.php function in WordPress to create all tables required for the application.

Step 6
Open the wp-config.php file with a text editor. You may also select “Edit” from within the CPanel File Manager.

Step 7
Locate the following lines of code. In first line of code, type the name of the database you created. In the second line, type the username of the user you added. In the third line, type the password for the userid you created.

define('DB_NAME', ''); // The name of the database
define('DB_USER', ''); // Your MySQL username
define('DB_PASSWORD', ''); // ...and password

Step 8
Save the changes to the wp-config.php file.

Step 9
Open a web browser and enter the URL to the administrative page of the WordPress installation. Add the install.php file name to the end of the URL. For example, if you installed WordPress into a directory named "WordPress", enter:


http://www.mydomain.com/wordpress/admin/install.php

When you open this file in the web browser, the installation script will automatically run and the database tables will automatically be created in the new database. If you receive an error, verify that you have typed the correct database information into the wp-config.php file.

That's it! WordPress is now installed through SSH.

Install WordPress Through CPanel

Installing WordPress via CPanel is very straightforward.

Step 1 - Access CPanel
Log onto your CPanel administration application with the credentials assigned to you by your web hosting company. In most cases, you will access CPanel through a URL such as cpanel.mydomain.com. where mydomain is your domain name.

Step 2 - Locate the Auto-Installer Software in CPanel
Look for the "Fantastico" or "Softaculous" icon in the CPanel administration interface.

Step 3 - Click on the Auto-Installer icon to open the application

Step 4 - Locate the "WordPress" link or icon in the available applications within the Auto-Installer page
Click on the WordPress link or icon to open the WordPress installation page. When the WordPress installation page opens, several fields will be automatically populated. For example, the installation directory will be auto-populated with a directory name, such as wp. The database name will also be auto-populated.

Step 5 - Edit the directory or database name, if you so desire

Step 6 - Type and verify the password for the "admin" account

You can also change the userid for the admin account, but you are advised to keep the userid administrative account login as “admin".

Step 7 - Install the WordPress platform
Click the "Install" link or button. The WordPress platform installs to the specified directory. You may see a progress bar while the installation is in process. Once the installation is finished, you will be notified about the URL of the installation, as well as the URL to the administrative interface. Generally, the administrative interface will be located in a subdirectory of the WordPress platform URL. For example, if WordPress installed at www.mydomain.com/wp, the administrative interface URL will likely be www.mydomain.com/wp/wp-admin.

That’s it! The WordPress platform has been installed using CPanel.

Install WordPress through Plesk

Plesk is web hosting account administration application similar to CPanel. Plesk’s appearance is decidedly similar to interfaces found within the Windows operating system. Plesk is easy to use and offers the "Application Vault" for quick, automated installations of platforms such as WordPress.

Step 1
Log into your web hosting account and open the Plesk interface. The “Desktop” interface will open.

Step 2
Click the "Home" link in the upper left corner of the "General" tab on the Desktop screen. The Home screen opens. Scroll to the bottom of the screen. The available domain names are listed.

Step3
Click the link of the domain name where you will install the WordPress platform. The default administration page for the domain name opens.

Step 4
Click the “Application Vault” icon.

Step 5
Click the “Add New Application” icon. A list of available applications for the Application Vault opens.

Step 6
Click the radio button next to the “WordPress” option.

Step 7
Check the “Target Domain” input box to ensure the correct domain is listed. If the correct domain name is not selected, click the arrow to the right side of the input box to show available domain names. Click the correct domain name.

Step 8
Scroll back up to the top of the screen and click the “Install” link. The WordPress installation and configuration screen opens.

Step 9
For the first option, select “Yes” or “No” if you would like to create a custom button for accessing the application in the administrative interface.

Step 10
In the “Destination Directory” section, click the “Other” option and then type a name for the directory where WordPress will be installed.

Step 11
Type and confirm a “Database Password” in the corresponding fields. Note that the database name and userid will be automatically populated.

Step 12
Type and confirm and administrative account password in the corresponding fields.

Step 13
Type an email address for the administrative emails.

Step 14
Type a title for the weblog into the “Weblog Title” input box.

Step 15
Click the "OK" button. WordPress is installed according to the specifications you have configured. A “Success” message will appear once the application installation is complete.

Install WordPress using FTP (Manual Installation)

When you use the FTP method to install WordPress, there are a few additional steps you will need to perform than with SSH or auto-installers. Essentially, you are using the FTP client to upload the WordPress compressed installation file to the web server and then manually installing the application once the installation package is on the server.

Step 1
Download the latest version of the WordPress installation package. Save the file to your desktop.

Step 2
Open your FTP client and log into the web server’s FTP account.

Step 3
Navigate to the public HTML directory for your domain name.

Step 4
Upload the WordPress compressed installation package directly into the public HTML folder using the FTP client.

Step 5
Open your CPanel application in a web browser and log into your hosting account.

Step 6
Click the “File Manager” icon. The File Manager opens.

Step 7
Navigate to the public HTML folder and click on the WordPress compressed installation package.

Step 8
Click the “Extract” button in the File Manager application. The files are extracted into a subfolder named “WordPress”.

Step 9
Click the “MySQL Databases” icon in the CPanel main interface. The MySQL Database page opens. You will now create the backend database for WordPress.

Step 10
Type a name for the new WordPress database in the “New Database” input box.

Step 11
Click the "Create Database" button. The new database is created and an notification is displayed. Click the "Go Back" button to return to the Database Management page. The new database is listed in the “Databases” section.

Step 12
Click the "Add New User" from the Database Management screen.

Step 13Type a name for the new user into the “Username” input box.

Step 14
Type and confirm a password for the new database user.

Step 15
Click the “Create User” button. The new user is created.

Step 16
Next, you will rename the wp-config-sample.php file in the WordPress directory unzipped before creating the database. Use the File Manager in CPanel or the FTP client to rename the file. Rename the file to “wp-config.php”.

Step 17
Open the wp-config.php file with a text editor. You may also select “Edit” from within the CPanel File Manager to edit the file directly in CPanel.

Step 18
Locate the following three lines of code. In first line of code, type the name of the database you created. In the second line, type the username of the user you added. In the third line, type the password for the userid you created. Note that your CPanel username will be prefixed to the database name and username you assign to the database. Assume that your CPanel user name is joe and the database name is db1. The database name that will be entered into the line of code will be joe_db1. If the username you assigned was “me1,” you will enter joe_me1 into the DB_User field.

define('DB_NAME', ''); // The name of the database
define('DB_USER', ''); // Your MySQL username
define('DB_PASSWORD', ''); // ...and password

Step 19
Save the changes to the wp-config.php file.

Step 20
Open a web browser and enter the URL to the administrative page of the WordPress installation. Add the install.php file name to the end of the URL. For example, if you installed WordPress into a directory named “WordPress”, enter:


http://www.mydomain.com/wordpress/admin/install.php

When you open this file in the web browser, the installation script will run and the database tables required for WordPress will automatically be created in the new database. If you receive an error, check the wp-config.php file for the correct database information.

Thats it! WordPress is now installed.

Install WordPress Using GitHub

GitHub is a repository for code. GitHub basically stores any code a developer may need on a common server. GitHub is used with Subversion, or "SVN". You will aneed to have SVN configured to interact with your GitHub repository.

SVN updates the WordPress installation files every 30 minutes automatically, so when you install WordPress from GitHub, you will be installing the latest version of the platform.

To install WordPress from GitHub:

Step 1
First, create a new project in GitHub. To do this, type each command below and press the “Enter” key after each command line:

mkdir newsite && cd newsite

git init

touch README.md

git add README.md

git commit -m "Initial commit."

A blank project has now been created. GitHub mirrors the WordPress installation file repository and the GitHub WordPress installation files are updated automatically every 30 minutes. When you install WordPress from GitHub, you will be receiving the latest version of WordPress.

Step 2
Add the GitHub WordPress mirror to the project by typing the following command at the command line and pressing the “Enter” key:

git submodule add git://github.com/WordPress/WordPress.git wp

Step 3
The cloning may take a little time. After the cloning is finished, type the following command.

git commit -m "Add WordPress subrepository."

Step 4
Ensure that you are installing the latest version of WordPress. To do so, type the following commands and change the number “3.3.2“ to the latest version of WordPress.

cd wp
git checkout 3.3.2
cd ..

Step 5
Now, commit the changes. Make sure you change the WordPress version number from "3.3.2" to the latest version once again.

git commit -am "Checkout WordPress 3.3.2"

Step 6
Next, create the WordPress configuration file. Type the following commands:

cp wp/wp-config-sample.php wp-config.php
git add wp-config.php
git commit -m "Adding default wp-config.php file"

Step 7
Copy the WordPress “Content” directory to the main project by typing the command below:

cp -R wp/wp-content

Step 8
Commit the “Content” directory with the following commands:

git add wp-content
git commit -m "Adding default wp-content directory"

Step 9
Copy the index.php file:

cp wp/index.php .
git add index.php
git commit -m "Adding index.php"

Step 10
Open the index.php file and locate the following line of code:

require('./wp-blog-header.php');

Change this line to:

require('./wp/wp-blog-header.php');

Commit the changes with the following command:

git commit -am "Pointing index.php to the correct location"

Step 11
Add the following lines of code into the wp-config.php file near the top of the file:

* @package WordPress
*/

define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/wp');
define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME']);


define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content');
define('WP_CONTENT_URL', 'http://' . $_SERVER['SERVER_NAME'] . '/wp-content');

Step 12
Create a database using the same procedure as in the FTP instructions above. Note the database name, database username and password. Enter the database information into the wp-config.php file where specified. (See FTP instructions above.)

Step 13
Commit the remaining changes to the GitHub project by typing the following command:

git commit -am "Update settings in wp-config.php"

WordPress is now installed using GitHub. 

Once WordPress is installed, regardless of the method you use to install the platform, you will be able to open WordPress by using a web browser and navigating to your domain name plus the name of the WordPress directory where you installed the files. The administrative interface is always located in a subdirectory named wp-admin appended to the URL of your WordPress installation. For example, if you installed WordPress in a directory named wp as the instructions have done, your URL would be http://www.mydomain.com/wp and the administrative interface would be located at http://www.mydomain.com/wp/wp-admin.

Conclusion

WordPress is a versatile platform that may be installed using a variety of methods. Installing the platform is straightforward. Once installed, you will be able to open the administrative interface, select the theme for your deployment, add plugins and set up your site.