Skip to content

WordPress

WordPress

License: GPLv2

This guide is tested with WordPress 6.9.4 on Uberspace 8.0.75. We can't guarantee it to work with newer versions.

WordPress is an open source blogging platform written in PHP and distributed under the GPLv2 license. WordPress was released in 2003 by Matt Mullenweg and Mike Little as a fork of b2/cafelog. It is maintained by the WordPress Foundation.


Note

For this guide you should be familiar with the basic concepts of:

Prerequisites

We're using PHP in the stable version 8.4:

[isabell@moondust ~]$ uberspace tool version set php 8.4
OK: Set version of php to 8.4

You'll need your MySQL credentials:

[isabell@moondust ~]$ my_print_defaults client
--default-character-set=utf8mb4
--user=isabell
--password=MySuperSecretPassword

Tip

If you want to use a custom domain for your blog, this domain must be setup correctly.

[isabell@moondust ~]$ uberspace web domain list

  Domain
 ───────────────
  isabell.uber.space

Installation

Preparation

First, let's pass some necessary configuration to environment variables to make the installation commands easier to use and suitable for copy-and-paste.

We define the URL and the title, the password for MySQL, the name of the database and last but not least an admin user:

[isabell@moondust ~]$ URL="${USER}.uber.space"
[isabell@moondust ~]$ TITLE="My super awesome blog"
[isabell@moondust ~]$ DBPASS="<MySuperSecretPassword>"
[isabell@moondust ~]$ DBNAME="${USER}_wordpress"
[isabell@moondust ~]$ ADMIN_USER="isabell"
[isabell@moondust ~]$ ADMIN_EMAIL="sysmail@isabell.uber.space"

Download

Change into your document root and download WordPress using WP-CLI:

[isabell@moondust ~]$ cd /var/www/virtual/${USER}/html
[isabell@moondust html]$ wp core download --locale=en_US
Downloading WordPress 6.9.4 (en_US)...
md5 hash verified: 9355f37ee9ec885c93e3ca87ba8538d4
Success: WordPress downloaded.

Configuration

Create a configuration file and the database:

[isabell@moondust html]$ wp config create --dbname=${DBNAME} --dbuser=${USER} --dbpass=${DBPASS}
Success: Generated 'wp-config.php' file.
[isabell@moondust html]$ wp db create
Success: Database created.

Run the installation:

[isabell@moondust html]$ wp core install --url=${URL} --title="${TITLE}" --admin_user="${ADMIN_USER}" --admin_email="${ADMIN_EMAIL}"
Admin password: SuperSecretSecurePassword
Success: WordPress installed successfully.

Info

WordPress generates a secure password for the admin user. You can log in at https://${URL}/wp-admin using the admin username and the generated password.

Updates

WordPress automatically keeps its core up to date.

When you use plugins and themes it's your responsibility to keep them up to date. The easiest way to keep everything fresh and safe is to enable auto-updates for all plugins and all themes:

[isabell@moondust html]$ wp plugin auto-updates enable --all
Success: Enabled 2 of 2 plugin auto-updates.
[isabell@moondust html]$  wp theme auto-updates enable --all
Success: Enabled 3 of 3 theme auto-updates.

Performance / Optimization

Info

Optimization is optional but we strongly suggest going the extra mile. Even if the content on your instance is straightforward and simple, this gives you plenty of room to grow without headaches and helps reduce the load on our servers.

PHP

As described in the WordPress PHP Optimization Guide, certain PHP settings are particularly beneficial for performance. Apply them by creating a ~/.config/php/wordpress.ini file:

max_execution_time = 180
memory_limit = 128M
post_max_size = 64M
upload_max_filesize = 64M
max_input_time = 60
max_input_vars = 3000

Reload your PHP environment to apply the changes:

[isabell@moondust ~]$ uberspace web php reload
OK: PHP-FPM service reloaded

Cronjob

By default, scheduled tasks are handled by the web server via wp-cron.php, which can result in longer page loading times for visitors. Hooking WP-Cron into the system task scheduler is heavily recommended.

To do so deactivate automatic execution via wp-cron.php:

[isabell@moondust ~]$ wp config set DISABLE_WP_CRON true --path=/var/www/virtual/${USER}/html
Success: Added the constant 'DISABLE_WP_CRON' to the 'wp-config.php' file with the value 'true'.

Create a shell script at ~/bin/wp_cron.sh:

#!/bin/bash

# exit on errors
set -e

# Sets the identifier tag for easy filtering later
IDENTIFIER=wp_cron

# Sets the command/script that should be executed
COMMAND="wp cron event run --due-now --path=/var/www/virtual/${USER}/html/"

# Log an informational message when the job starts
logger -t "${IDENTIFIER}" "Cron job execution started."

# Run the actual job
${COMMAND}

# Log a message when the job finishes
logger -t "${IDENTIFIER}" "Cron job execution finished successfully."

Make it executable:

[isabell@moondust ~]$ chmod +x ~/bin/wp_cron.sh

Add the following job to your crontab to call the scheduler every five minutes:

*/5 * * * * systemd-cat -t wp_cron ~/bin/wp_cron.sh

Info

With systemd-cat logs are written to your journal. Use journalctl --user --unit wp_cron to read the logs.

Caching

WordPress caching is the fastest way to improve performance.

From our experience it makes sense to setup W3 Total Cache, PHP’s OPcache, and Redis as a backend to distribute load across multiple layers.

Redis Setup

Create a working directory for your Redis service:

[isabell@moondust ~]$ mkdir ~/.redis

Create the configuration file ~/.redis/conf, replace <user> with your Uberspace username (isabell):

unixsocket /home/<user>/.redis/sock
daemonize no
port 0
save ""

Set up the service:

[isabell@moondust ~]$ uberspace service add redis "redis-server /home/${USER}/.redis/conf" --workdir /home/${USER}/.redis/
OK: Created service file: /home/isabell/.config/systemd/user/redis.service
OK: systemctl --user daemon-reload
OK: systemctl --user start redis.service
OK: systemctl --user enable redis.service
OK: systemctl --user status redis.service
...
May 01 13:12:05 moondust.uberspace.de redis-server[835730]: 835730:M 07 May 2026 20:22:56.535 * Ready to accept connections unix

OPcache Setup

OPcache is a built-in caching engine that improves PHP performance by storing precompiled script bytecode in the server's shared memory. By eliminating the need to read and parse PHP code from scratch on every single request, it drastically reduces application execution time and server load.

For the setup you need to get your User ID:

[isabell@moondust ~]$ id -u
1055

Create ~/.config/php/opcache.ini and replace <uid> with your UID (in our case 1055):

opcache.enable=1
opcache.enable_cli=0
opcache.validate_timestamps=1
opcache.revalidate_freq=300
opcache.revalidate_path=0
opcache.max_accelerated_files=16229
opcache.max_wasted_percentage=5
opcache.memory_consumption=256
opcache.interned_strings_buffer=64
opcache.fast_shutdown=1
opcache.file_cache=/var/run/user/<uid>/cache
opcache.save_comments=1

Reload your PHP environment to apply the changes:

[isabell@moondust ~]$ uberspace web php reload
OK: PHP-FPM service reloaded

W3 Total Cache Configuration

Install and activate the caching plugin:

[isabell@moondust ~]$ wp plugin install w3-total-cache --activate --path=/var/www/virtual/${USER}/html
Installing W3 Total Cache (2.9.4)
...
Plugin 'w3-total-cache' activated.
Success: Installed 1 of 1 plugins.

Enable the plugin components for Object Cache, Page Cache, and Database Cache:

[isabell@moondust ~]$ for c in objectcache pgcache dbcache; do wp total-cache option set "${c}".enabled true --type=boolean --master --path=/var/www/virtual/${USER}/html/ ; done
Success: Option updated successfully.
Success: Option updated successfully.
Success: Option updated successfully.

Set Redis as the cache engine:

[isabell@moondust ~]$ for c in objectcache pgcache dbcache; do wp total-cache option set "${c}".engine "redis" --master --path=/var/www/virtual/${USER}/html/; done
Success: Option updated successfully.
Success: Option updated successfully.
Success: Option updated successfully.

Point the configuration to your Unix socket:

[isabell@moondust ~]$ for c in objectcache pgcache dbcache; do wp total-cache option set "${c}".redis.servers "/home/${USER}/.redis/sock:0" --master --path=/var/www/virtual/${USER}/html/ ; done
Success: Option updated successfully.
Success: Option updated successfully.
Success: Option updated successfully.

Disable TLS verification (as the connection is internal via a local socket):

[isabell@moondust ~]$ for c in objectcache pgcache dbcache; do wp total-cache option set "${c}".redis.verify_tls_certificates "false" --type=boolean --master --path=/var/www/virtual/${USER}/html/; done
Success: Option updated successfully.
Success: Option updated successfully.
Success: Option updated successfully.

Finally, flush the cache to ensure everything works smoothly:

[isabell@moondust ~]$ wp cache flush --path=/var/www/virtual/${USER}/html/
Success: The cache was flushed.