Overview
WordPress is the most widely used content management system for websites and blogs. You can install it manually on any ALYPOD Pod that runs a web server and PHP, or use a one-click install in cPanel, Plesk or CWP. This article covers the manual method, which works everywhere.
Before you begin
- A CPU Pod with Apache or Nginx, PHP 8.1+ and MySQL/MariaDB installed.
- A database and database user for WordPress.
- A domain or subdomain pointing to the Pod.
- SSH and sudo/root access (or an SFTP client).
Steps
- Install the required PHP extensions for WordPress:
```bash
Debian / Ubuntu
sudo apt install -y php php-mysql php-curl php-gd php-mbstring php-xml php-zip php-imagick
RHEL family
sudo dnf install -y php php-mysqlnd php-gd php-mbstring php-xml php-zip ```
- Create the database and user:
sql
CREATE DATABASE wordpress CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'strong-password-here';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
- Download WordPress into your web root and set ownership:
bash
cd /var/www
curl -O https://wordpress.org/latest.tar.gz
tar xzf latest.tar.gz
mv wordpress example.com
chown -R www-data:www-data example.com # use apache:apache on RHEL
- Copy the sample config and generate security keys:
bash
cd example.com
cp wp-config-sample.php wp-config.php
curl -s https://api.wordpress.org/secret-key/1.1/salt/
Edit
wp-config.phpto setDB_NAME,DB_USER,DB_PASSWORD,DB_HOST, and paste the generated salts.Create an Apache vhost (or Nginx server block) for the domain, then reload the web server:
bash
sudo systemctl reload apache2 # or: nginx -s reload
- Visit
https://example.comand complete the five-minute install (site title, admin user, email).
Troubleshooting
- Problem: "Error establishing a database connection". Solution: Re-check the
credentials in
wp-config.phpand that MySQL is running. - Problem: Cannot upload files or install plugins. Solution: Fix ownership and
permissions: directories
755, files644, owner matching the web user. - Problem: Permalinks return 404. Solution: Enable
mod_rewrite(Apache) or addtry_files $uri $uri/ /index.php?$args;to the Nginx block.
Related articles
- [Securing WordPress]
- [Installing MySQL and MariaDB]
- [Setting up a free Let's Encrypt SSL certificate]
