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:
| Software | Recommended |
|---|---|
| PHP | 8.3 or greater |
| Database | MariaDB 10.11 or greater, or MySQL 8.0 or greater |
| Web server | Apache or Nginx |
| HTTPS | Supported 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
- Download the latest zip from wordpress.org/download and unzip it.
- Upload the files to the web root folder of your host (
public_html), or tohtdocsif you use XAMPP. - Create an empty database and a database user with full rights on it (use phpMyAdmin or your host panel).
- Open your site address in the browser. WordPress asks for the database name, user, password and host. It writes the
wp-config.phpfile for you. - Fill the site title, an admin username, a strong password and your email. Click Install WordPress.
- Log in at
/wp-admin. Your site is ready.
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:
$ 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
| Exercises & Assignments |
|---|
| No Content Found. |
| Interview Questions & Answers |
|---|
| No Content Found. |