AdminsForum

CyberPanel WordPress & LSCache Guides

Guide Install WordPress on CyberPanel With LiteSpeed Cache (Free Way, WP-CLI)

Started by JAY 0 replies 120 views
1JAY
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
#1
Install WordPress on CyberPanel With LiteSpeed Cache (Free Way, WP-CLI)

WordPress on OpenLiteSpeed with the LiteSpeed Cache plugin is one of the fastest setups you can run on a small VPS, and the main reason many people pick CyberPanel.

Watch it: Part 6 of the CyberPanel course, WordPress with LiteSpeed Cache

This is Part 6 of 10 in our free CyberPanel Full Course. The written steps below go into more detail.

One surprise first: on our CyberPanel 3.0 server, the WordPress menu didn't open an installer. It opened the WordPress Manager pricing page (staging, backups, auto login and one-click install are sold as an add-on). You don't need it. This guide does the same job for free, in about five minutes, with WP-CLI, the official WordPress command line tool. We did every step below on our test site cyber.adminslab.com.

What you need
Step 1: Create the database
Open Databases & FTP > Create Database. Pick the website, type a short name and user, and click Generate for a strong password:
[Image: attachment.php?aid=458]

CyberPanel adds a prefix to both names. On our site it became
Code:
cyber_wp
for the database and
Code:
cyber_wp
for the user. Click Use This Password, copy the password somewhere safe (a password manager), then Create Database. More about this page in our databases and phpMyAdmin guide.

Step 2: Install WP-CLI (once per server)
WP-CLI wasn't installed on our fresh CyberPanel server (
Code:
wp: command not found
). Install it:
Code:
curl -sLo /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar chmod +x /usr/local/bin/wp wp --version --allow-root
We got
Code:
WP-CLI 2.12.0
.

Step 3: Download WordPress as the site user
Run WordPress commands as the website's own Linux user, never as root, so every file gets the right owner. Find the user name:
Code:
ls -la /home/cyber.adminslab.com/public_html
Ours is
Code:
cyber2602
. Then remove CyberPanel's placeholder page and download WordPress:
Code:
cd /home/cyber.adminslab.com/public_html rm -f index.html sudo -u cyber2602 wp core download
Removing
Code:
index.html
matters: if it stays, visitors keep seeing the placeholder instead of WordPress.

Step 4: Create wp-config.php and install
Type the database password without it landing in your shell history:
Code:
read -s -p "DB password: " P; echo sudo -u cyber2602 wp config create --dbname=cyber_wp --dbuser=cyber_wp --dbpass="$P" --dbhost=localhost
Then install WordPress. Choose your own admin user name (not "admin") and a strong password:
Code:
read -s -p "WP admin password: " A; echo sudo -u cyber2602 wp core install --url=https://cyber.adminslab.com --title="My Site" \ --admin_user=youradmin [email protected] --admin_password="$A" --skip-email
You should see
Code:
Success: WordPress installed successfully.
Use the https address in
Code:
--url
so WordPress doesn't start on http.

Step 5: Install LiteSpeed Cache
Code:
sudo -u cyber2602 wp plugin install litespeed-cache --activate
The plugin writes its rules into
Code:
.htaccess
. Now the step most guides skip: OpenLiteSpeed only reads .htaccess changes after a restart. On our server the cache did nothing until we ran:
Code:
systemctl restart lsws

Step 6: Check the cache really works
Request the home page twice and look at the
Code:
x-litespeed-cache
header:
Code:
for i in 1 2; do curl -s -o /dev/null -D - https://cyber.adminslab.com/ | grep -i x-litespeed-cache:; done
Here is the whole check on our server: WordPress 7.1.3, LiteSpeed Cache 7.9.2 active, first request a miss, second a hit:
[Image: attachment.php?aid=543]
  • miss then hit: the cache is working.
  • No header at all: restart lsws (Step 5) and try again. Logged-in visitors and POST requests are never cached, so test with curl or a private window.

After the install
  • Log in at
    Code:
    https://yourdomain.com/wp-admin/
    . LiteSpeed Cache adds its own LiteSpeed Cache menu; the defaults are fine to start with.
  • Forgot the admin password? Set a new one from SSH:
    Code:
    sudo -u cyber2602 wp user update youradmin --prompt=user_pass
  • Keep WordPress updated:
    Code:
    sudo -u cyber2602 wp core update && sudo -u cyber2602 wp plugin update --all
  • Upload limit too small for themes or imports? See changing PHP settings in CyberPanel.
  • Missing imagick in Site Health? See installing PHP extensions.

Common problems
  • "Error establishing a database connection": wrong database name, user or password in wp-config.php (remember the prefix), or MariaDB stopped: check the services.
  • Still seeing the CyberPanel placeholder:
    Code:
    index.html
    is still in public_html.
  • Plugin or theme install asks for FTP details: files are owned by root. Fix with
    Code:
    chown -R cyber2602:cyber2602 /home/cyber.adminslab.com/public_html/*
    (your own user name).
  • Redirect loop behind Cloudflare: set Cloudflare's SSL mode to Full (strict), not Flexible.

More CyberPanel guides
Tested on CyberPanel 3.0 (build 8, OpenLiteSpeed edition) on Ubuntu 24.04, October 2026. Menu names can change slightly between versions.

Attached Files

Image(s)
       
Reply
Possibly Related Threads…matched by title
Replies:0Views:1
Replies:0Views:89

Users browsing this thread: 1 Guest(s)
Forum Jump: