---
title: "Installing WordPress"
date: "2015-01-30"
category: "wordpress"
slug: "installing-wordpress"
---

## Overview

WordPress is a popular content management system suitable for everything from simple websites to full eCommerce shops. This guide covers both the one-click and manual installation methods in the ApisCP control panel.

## One-Click Installation

The fastest way to install WordPress:

1. Go to **Web** > **Web Apps** within the [[logging-into-the-control-panel]]
2. Select the hostname from the dropdown list
    - To install WordPress in a subdirectory, click the dropdown and select _Edit Subdir_. Select or create the folder.

        ![Edit Subdir indicator in Web > Web Apps](kb-image:edit-subdir-indicator.png)
*Edit Subdir indicator in Web > Web Apps*
3. Click **Install WordPress** under Actions
4. WordPress will install and a verification email with your login credentials will be sent to the administrative address on the account
    - The destination directory must be empty. Remove existing files first via **Files** > **File Manager** if needed.

        ![WordPress and other web app installation options in ApisCP.](kb-image:wordpress-install.png)
*WordPress and other web app installation options in ApisCP.*

## Manual Installation

Manual installation involves three steps: creating a database, uploading files, and running the WordPress setup wizard. For the fastest experience, use [[accessing-ftp-server]] or [[accessing-terminal]].

### Prerequisites

1. Log in to the [[logging-into-the-control-panel]]
2. Create a [[creating-database]] via **Databases** > **MySQL Manager**
    - In this example, the database is called `wordpress` with an account prefix of `ex_`
3. Determine the [[where-is-site-content-served-from]] for your WordPress installation:
    - **Primary domain**: WordPress installs under `/var/www/html` (skip this step)
    - **Addon domain**: Add one via **DNS** > **Addon Domains**
    - **Subdomain** (e.g. `http://blog.mydomain.com`): Add one via **Web** > **Subdomains**
    - In this example, WordPress is installed on a subdomain called `blog` at `/var/www/wp`

### Uploading WordPress Files

Choose one of the following methods (listed fastest to slowest):

#### Option 1: Terminal Download

Available only for accounts with [[is-terminal-access-available]].

1. Log in to the [[accessing-terminal]]
2. Navigate to the [[where-is-site-content-served-from]]:
    - `cd /var/www/wp`
3. Download and extract WordPress:
    - `wget http://wordpress.org/latest.zip && unzip latest.zip && rm -f latest.zip `
4. Move files from `wordpress/` to the current directory:
    - `cd wordpress/ && mv * ../ && cd .. && rmdir wordpress`

#### Option 2: FTP Upload

The fastest method available to all accounts:

1. Download [latest.zip](https://wordpress.org/latest.zip) from WordPress.org
2. Log in to the [[accessing-ftp-server]]
3. Navigate to the [[where-is-site-content-served-from]] for your WordPress site
4. Upload the files from inside the `wordpress/` folder in the zip to the remote directory

#### Option 3: Control Panel File Manager

If you prefer not to use FTP, the built-in File Manager works, though it requires more steps. Using [[accessing-ftp-server]] is recommended for speed.

1. Navigate to **Files** > **File Manager** in the control panel
2. Switch to the target folder via **Change Directory** > **Browse...** under Current Path
3. Under **Commands** > **Remote URL**, enter `http://wordpress.org/latest.zip` and click **Download and Extract**
    - Delete `index.html` if it exists -- this placeholder file takes precedence over WordPress's [[changing-index-pages]] (`index.php`). Hover over the file, go to _Actions_, and select _Delete_.

        ![Summary of actions to do in File Manager: remove index.html, enter URL, click button.](kb-image:filemanager-wp-setup.png)
*Summary of actions to do in File Manager: remove index.html, enter URL, click button.*
4. Open the newly created `wordpress/` directory
5. Select all files, then use **Commands** > **Add Selected File(s) to Clipboard**

    ![WordPress bulk selection files in the control panel.](kb-image:wp-selected-files.png)
*WordPress bulk selection files in the control panel. These files will be moved down a directory.*
6. Click **Parent Directory** to go back up one level
7. Under **Clipboard Contents**, click **Move**

    ![Managing WordPress clipboard contents to move up a directory.](kb-image:wordpress-clipboard-view.png)
*Managing WordPress clipboard contents to move up a directory.*
8. Remove the now-empty `wordpress/` directory: select it, then **Commands** > **Delete Selected Files** with **recursive** enabled

### Running the Installation Wizard

1. Visit your WordPress site in a browser (e.g. `http://blog.mydomain.com`)
2. Enter your database details:
    - **Database Name**: The database created earlier (e.g. `ex_wordpress`)
    - **User Name**: Your control panel username or a dedicated database user (recommended for security)
    - **Password**: The corresponding password (see [[resetting-mysql-password]] if needed)
    - **Database Host**: Leave as `localhost`
    - **Table Prefix**: Leave as `wp_`

        ![WordPress database settings following this walkthrough.](kb-image:wordpress-database-settings.png)
*WordPress database settings following this walkthrough.*
3. WordPress generates a `wp-config.php` file that must be uploaded manually due to security restrictions. Copy the displayed configuration into a text editor, save as `wp-config.php`, and upload it to your WordPress directory (e.g. `/var/www/wp`) via terminal, FTP, or File Manager.

        ![Uploading wp-config.php during installation in the File Manager.](kb-image:wp-config-enqueued-file-manager.png)
*Uploading wp-config.php during installation in the File Manager.*
4. Click **Run the install** to complete setup
    - Choose a username other than `admin`
    - Use a strong password -- weak passwords and outdated installations are the most common causes of compromised sites

## Configuring Write Access

After installation, grant WordPress write access to specific directories so it can handle media uploads while keeping the rest of your account secure. See [[enabling-write-access]] for details.

At minimum, enable write access to `wp-content/uploads/`. Files in this directory are served as static media only, preventing attackers from uploading and executing malicious PHP scripts.

## See Also

- [[updating-wordpress]]
- [[wordpress]]
- [WordPress Codex](http://codex.wordpress.org/) (main documentation)
- [WordPress Lessons](http://codex.wordpress.org/WordPress_Lessons)
- [WordPress Themes](https://wordpress.org/themes/)
- [WordPress Popular Plugins](https://wordpress.org/plugins/browse/popular/)
