How to install WordPress

WordPress is well-known for its ease of installation. Under most circumstances, installing WordPress is a very simple process and takes less than five minutes to complete. Many web hosts now offer tools (e.g. Fantastico) to automatically install WordPress for you. However, if you wish to install WordPress yourself, the following guide will help. Now with Automatic Upgrade, upgrading is even easier.

The following installation guide will help you, whether you go for the Famous 5 Minute Installation, or require the more detailed installation guide.

5 basic steps

If you are using a hosting provider, you may already have a WordPress database set up for you, or there may be an automated setup solution to do so. Check your hosting provider's support pages or your control panel for clues about whether or not you'll need to create one manually.

If you determine that you'll need to create one manually, follow the instructions for accessing phpMyAdmin on various servers, or follow the instructions for Using cPanel or Using phpMyAdmin below.

If you are installing WordPress on your own web server, follow the Using phpMyAdmin or Using the MySQL Client instructions below to create your WordPress username and database.

If you have only one database and it is already in use, you can install WordPress in it - just make sure to have a distinctive prefix for your tables to avoid over-writing any existing database table.

Step 3: Set up wp-config.php

You can either create and edit the wp-config.php file yourself, or you can skip this step and let WordPress try to do this itself when you run the installation script (step 5) (you'll still need to tell WordPress your database information).

(For more extensive details, and step by step instructions for creating the configuration file and your secret key for password security, please see Editing wp-config.php.)

Return to where you extracted the WordPress package in Step 1, rename the file wp-config-sample.php to wp-config.php, and open it in a text editor.

Step 4: Upload the files

Now you will need to decide where on your domain you'd like your WordPress-powered site to appear:

Note: The location of your root web directory in the filesystem on your web server will vary across hosting providers and operating systems. Check with your hosting provider or system administrator if you do not know where this is.

Step 5: Run the Install Script

Point a web browser to start the installation script.

If you placed the WordPress files in the root directory, you should visit: http://example.com/wp-admin/install.php
If you placed the WordPress files in a subdirectory called blog, for example, you should visit: http://example.com/blog/wp-admin/install.php

Finishing installation

Notice in Entering the details screen, you enter your site title, your desired user name, your choice of a password (twice) and your e-mail address. Also displayed is a check-box asking if you would like your blog to appear in search engines like Google and Technorati. Leave the box checked if you would like your blog to be visible to everyone, including search engines, and uncheck the box if you want to block search engines, but allow normal visitors. Note all this information can be changed later in your Administration Panels.

Detailed Instructions

Step 1: Download and Extract

If you work on your own computer, on most Linux distributions you can install WordPress automatically: on Mageia (KDE), thanks to Mageia control center; on Fedora 20 (Gnome), you will not find it in "Software", which only include applications with proper GUI, but you can install from there a package called "Packages" containing the application "Packages", alias "Software install", and, thanks to "Packages", you can install Wordpress. We advise you to install PhpMyAdmin at the same time.

If you will be uploading WordPress to a remote web server, download the WordPress package to your computer with a web browser and unzip the package.

If you will be using FTP, skip to the next step - uploading files is covered later.

If you have shell access to your web server, and are comfortable using console-based tools, you may wish to download WordPress directly to your web server using wget (or lynx or another console-based web browser) if you want to avoid FTPing:

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

Then unzip the package using: tar -xzvf latest.tar.gz

The WordPress package will extract into a folder called wordpress in the same directory that you downloaded latest.tar.gz

Step 2: Create the Database and a User

If you are using a hosting provider, you may already have a WordPress database set up for you, or there may be an automated setup solution to do so. Check your hosting provider's support pages or your control panel for clues about whether or not you'll need to create one manually.

If you have only one database and it is already in use, you can install WordPress in it - just make sure to have a distinctive prefix for your tables to avoid over-writing any existing database table.

Using cPanel

If your hosting provider supplies the cPanel hosting control panel, you may follow these simple instructions to create your WordPress username and database. A more complete set of instructions for using cPanel to create the database and user can be found in Using cPanel.

Using phpMyAdmin

If your web server has phpMyAdmin installed, you may follow these instructions to create your WordPress username and database. If you work on your own computer, on most Linux distributions you can install PhpMyAdmin automatically.

Note: These instructions are written for phpMyAdmin 3.5; the phpMyAdmin user interface can vary slightly between versions.

If a database relating to WordPress does not already exist in the Database dropdown on the left, create one:

Choose a name for your WordPress database: 'wordpress' or 'blog' are good, but most hosting services (specially shared hosting) will require a name beginning with your username there and an underscore, so, even if you work on your own computer, we advise you to check now your hosting service requirements so that you conform with them on your own server and would be able to transfer your database without modification when it will be ready. Enter the chosen database name in the Create database field and choose the best collation for your language and encoding. In most cases it's better to choose in the "utf8_" series and, if you don't find your language, to choose "utf8_unicode_ci" (Reference: StackOverFlow.com).

After naming the database (here "fiable_wordpress") and choosing the collation (here "unicode_general_ci"), click on the Create button

Click the phpMyAdmin icon in the upper left to return to the main page, then click the Users tab. If a user relating to WordPress does not already exist in the list of users, create one:

Click Add user.

Choose a username for WordPress ('wordpress' is good) and enter it in the User name field. (Be sure Use text field: is selected from the dropdown.)

Choose a difficult-to-guess password (ideally containing a combination of upper- and lower-case letters, numbers, and symbols), and enter it in the Password field. (Be sure Use text field: is selected from the dropdown.) Re-enter the password in the Re-type field.

Write down the username and password you chose.

Leave all options under Global privileges at their defaults.

Click Go.

Return to the Users screen and click the Edit privileges icon on the user you've just created for WordPress. In the Database-specific privileges section, select the database you've just created for WordPress under the Add privileges to the following database dropdown. The page will refresh with privileges for that database. Click Check All to select all privileges, and click Go.

On the resulting page, make note of the host name listed after Server: at the top of the page. (This will usually be localhost.)

Using the MySQL Client

You can create MySQL users and databases quickly and easily by running mysql from the shell. The syntax is shown below and the dollar sign is the command prompt:

that root is also the adminusername. It is a safer practice to choose a so-called "mortal" account as your mysql admin, so that you are not entering the command "mysql" as the root user on your system. (Any time you can avoid doing work as root you decrease your chance of being exploited). The name you use depends on the name you assigned as the database administrator using mysqladmin.

wordpress or blog are good values for databasename.

wordpress is a good value for wordpressusername but you should realize that, since it is used here, the entire world will know it too.

hostname will usually be localhost. If you don't know what this value should be, check with your system administrator if you are not the admin for your Wordpress host. If you are the system admin, consider using a non-root account to administer your database.

password should be a difficult-to-guess password, ideally containing a combination of upper- and lower-case letters, numbers, and symbols. One good way of avoiding the use of a word found in a dictionary is to use the first letter of each word in a phrase that you find easy to remember.

If you need to write these values somewhere, avoid writing them in the system that contains the things protected by them. You need to remember the value used for databasename, wordpressusername, hostname, and password. Of course, since they are already in (or will be shortly) your wp-config.php file, there is no need to put them somewhere else, too.

b. "Reseller" accounts or "Admin" accounts may need to click "User Level." They also must first log-in as "Reseller" if the relevant domain is a Reseller's primary domain... or log-in as a "User" if the domain is not a Reseller's primary domain. If a Reseller's primary domain, then when logged-in as Reseller, you simply click "User Level." However if the relevant domain is not the Reseller's primary domain, then you must log-in as the relevant User. Then click "MySQL Management." (If not readily visible, perhaps you need to return to the Reseller or Admin level, and modify the "Manage user package" or "Manage Reseller package" to enable MySQL.)

c. In "MySQL Management," click on the small words: "Create new database." Here you are asked to submit two suffixes for the database and its username. For maximum security, use two different sets of 4-6 random characters. Then the password field has a "Random" button that generates an 8-character password. You may also add more characters to the password for maximum security. "Create." The next screen will summarize the database, username, password and hostname. Be sure to copy and paste these into a text file for future reference.

Step 3: Set up wp-config.php

You can either create and edit the wp-config.php file yourself, or you can skip this step and let WordPress try to do this itself when you run the installation script (step 5) (you'll still need to tell WordPress your database information).

(For more extensive details, and step by step instructions for creating the configuration file and your secret key for password security, please see Editing wp-config.php.)

Return to where you extracted the WordPress package in Step 1, rename the file wp-config-sample.php to wp-config.php, and open it in a text editor.

The hostname you determined in Step 2 (usually localhost, but not always; see some possible DB_HOST values). If a port, socket, or pipe is necessary, append a colon (:) and then the relevant information to the hostname.

Step 4: Upload the files

In a subdirectory of your web site. (For example, http://example.com/blog/)

Note: The location of your root web directory in the filesystem on your web server will vary across hosting providers and operating systems. Check with your hosting provider or system administrator if you do not know where this is.

In the Root Directory

If you need to upload your files to your web server, use an FTP client to upload all the contents of the wordpress directory (but not the directory itself) into the root directory of your web site.

If your files are already on your web server, and you are using shell access to install WordPress, move all of the contents of the wordpress directory (but not the directory itself) into the root directory of your web site.

In a Subdirectory

If you need to upload your files to your web server, rename the wordpress directory to your desired name, then use an FTP client to upload the directory to your desired location within the root directory of your web site.

If your files are already on your web server, and you are using shell access to install WordPress, move the wordpress directory to your desired location within the root directory of your web site, and rename the directory to your desired name.

Note: If your FTP client has an option to convert file names to lower case, make sure it's disabled.

Step 5: Run the Install Script

Point a web browser to start the installation script.

If you placed the WordPress files in the root directory, you should visit: http://example.com/wp-admin/install.php

If you placed the WordPress files in a subdirectory called blog, for example, you should visit: http://example.com/blog/wp-admin/install.php

Setup configuration file

If WordPress can't find the wp-config.php file, it will tell you and offer to try to create and edit the file itself. (You can do also do this directly by loading wp-admin/setup-config.php in your web browser.) WordPress will ask you the database details and write them to a new wp-config.php file. If this works, you can go ahead with the installation; otherwise, go back and create, edit, and upload the wp-config.php file yourself (step 3).