WordPress Installation

There are many ways to install WordPress. For learning, you should install it on your own computer (localhost), so you can break things without any problem. On a real hosting you can use the one click installer of your host, or the manual way below.

Requirements

The official WordPress.org page recommends these versions:

SoftwareRecommended
PHP8.3 or greater
DatabaseMariaDB 10.11 or greater, or MySQL 8.0 or greater
Web serverApache or Nginx
HTTPSSupported by the host

Very old versions (PHP 7.4 and MySQL 5.5.5) still work as the minimum, but they are not secure anymore. Always use a supported version.

Option 1: The famous 5 minute install

  1. Download the latest zip from wordpress.org/download and unzip it.
  2. Upload the files to the web root folder of your host (public_html), or to htdocs if you use XAMPP.
  3. Create an empty database and a database user with full rights on it (use phpMyAdmin or your host panel).
  4. Open your site address in the browser. WordPress asks for the database name, user, password and host. It writes the wp-config.php file for you.
  5. Fill the site title, an admin username, a strong password and your email. Click Install WordPress.
  6. Log in at /wp-admin. Your site is ready.
Note: On XAMPP, put the files in htdocs/mysite, create the database mysite in phpMyAdmin, and open http://localhost/mysite. The database host is localhost, user is root and the password is empty (only for local use, never on a live server).

Option 2: Local setup with Docker

If you have Docker, you can run WordPress and a database with one file. Save this as compose.yaml in an empty folder:

services:
  db:
    image: mariadb:11
    environment:
      MARIADB_DATABASE: wordpress
      MARIADB_USER: wp
      MARIADB_PASSWORD: wp-password
      MARIADB_ROOT_PASSWORD: root-password
    volumes:
      - db_data:/var/lib/mysql
  wordpress:
    image: wordpress:latest
    ports:
      - "8080:80"
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: wp
      WORDPRESS_DB_PASSWORD: wp-password
      WORDPRESS_DB_NAME: wordpress
    volumes:
      - ./site:/var/www/html
    depends_on:
      - db
volumes:
  db_data:
docker compose up -d

Now open http://localhost:8080 in your browser and finish the 5 minute install. The files of your site will be in the site folder. Passwords here are only examples for local practice.

Option 3: Install with WP-CLI

WP-CLI can do the full install with commands. This is also the fastest way for developers. The commands below were run on a clean test server. WP-CLI downloads WordPress, writes the config file, creates the database and installs the site:

Terminal output

$ wp core download –path=my-site –quiet
$ wp config create –path=my-site –dbname=demo –dbuser=root –dbpass=root –dbhost=wpdb –skip-check
Success: Generated 'wp-config.php' file.
$ wp db create –path=my-site
Success: Database created.
$ wp core install –path=my-site –url=http://example.com –title="My Site" –admin_user=admin –admin_password=ChangeMe123! –admin_email=you@example.com –skip-email
Success: WordPress installed successfully.
$ wp core version –path=my-site
7.1.4

Note: Use a strong password on a real site. The password above is only for a practice setup. Next: WordPress Frontend and Backend.

Congratulations! Chapter Finished. Learn more about the similar topics:
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.