Back to articles
DevOps & Systems

High-Speed WordPress Hosting on VPS with LiteSpeed LSCache: Detailed Setup Guide and Real Results

Running WordPress efficiently on a VPS requires a server configuration optimized for high performance. LiteSpeed Web Server combined with LSCache is the top solution to accelerate...

DPTCloud Engineering4 min read
High-Speed WordPress Hosting on VPS with LiteSpeed LSCache: Detailed Setup Guide and Real Results

Image credit: Kanenori · Pixabay Content License

Running WordPress efficiently on a VPS requires a server configuration optimized for high performance. LiteSpeed Web Server combined with LSCache is the top solution to accelerate websites, reduce server load, and enhance user experience. This guide provides a detailed installation process on a VPS, cache configuration, Nginx optimization, and real-world speed testing using performance tools. The guide includes both setup and optimization sections, suitable for DevOps users aiming to improve WordPress performance without switching to expensive hosting.

Introduction to LiteSpeed and LSCache

LiteSpeed Web Server is an open-source web server compatible with Apache and Nginx but delivers superior performance through its event-driven architecture and integrated caching. LSCache is LiteSpeed’s built-in caching module, operating at the server level to store processed HTML pages, significantly reducing response time for each request. Compared to external caching solutions like Redis or Memcached, LSCache requires no complex setup and performs effectively right after installation. When combined with an NVMe VPS, overall performance reaches high levels, especially for WordPress sites with dynamic content and concurrent access.

Requirements and Environment Preparation

To successfully deploy, you need a VPS with the following specifications:
- CPU: At least 2 cores
- RAM: Minimum 4GB (recommended 8GB for multiple sites)
- SSD NVMe: 50GB or more
- Operating System: Ubuntu 20.04 or 22.04 LTS
- Network Connection: High speed and stable

You can use NVMe Cloud VPS for quick deployment. Before installation, ensure the VPS is updated and has root access. Start the session with the command:

sudo apt update && sudo apt upgrade -y

Installing LiteSpeed and LSCache

Run the following commands to install LiteSpeed Web Server and the WordPress LiteSpeed Cache plugin:

# Download and run LiteSpeed installer
wget https://www.litespeedtech.com/packages/lsphp/lsphp81/litespeed-ws-8.1.sh
chmod +x litespeed-ws-8.1.sh
sudo ./litespeed-ws-8.1.sh

# Install PHP 8.1 and required modules
sudo apt install php8.1 php8.1-fpm php8.1-mysql php8.1-curl php8.1-gd php8.1-mbstring php8.1-xml php8.1-zip -y

# Install LiteSpeed Cache plugin for WordPress
# Access WordPress site > Plugins > Add New > Search for "LiteSpeed Cache" and install

After installation, access the LiteSpeed admin panel at https://your-server-ip:7080 and log in with root credentials. In the interface, enable LSCache and configure options such as: "Enable Page Cache", "Cache Dynamic Content", and "Cache Expiration" as needed.

Optimization and Performance Testing

After configuration, test performance using tools like GTmetrix, WebPageTest, or Pingdom. Key metrics to monitor include:
- Page load time (Time to First Byte, Fully Loaded)
- Cache hit rate
- Number of HTTP requests

For example, with a WordPress site featuring static content, page load time can drop from 1.2 seconds to under 0.3 seconds after enabling LSCache. Additionally, combining with Cloudflare to enhance CDN and reduce server load is recommended.

Troubleshooting Common Issues

Common errors include:
- **Cannot access the site**: Check the firewall and ensure ports 80 and 443 are open. Use the command sudo ufw allow 80,443.
- **Caching not working**: Verify the LiteSpeed Cache plugin is activated and correctly configured. Check the wp-config.php file to ensure no other caching plugins are active.
- **No performance improvement**: Ensure LiteSpeed is running and not blocked by other services like Nginx or Apache.

To check the status, use the command:

sudo lswsctrl status

If errors occur, review logs at /usr/local/lsws/logs/error.log.

References

DPTCloud Tier III Infrastructure

Recommended NVMe Cloud VPS Plans to Deploy This Setup

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478