How to Install WordPress on Ubuntu Linux with OpenLiteSpeed

This post shows students and new users steps to install WordPress CMS on Ubuntu Linux with OpenLiteSpeed web server. When webmasters think of hosting a WordPress website, most will choose between Apache and Nginx webservers.

Few people have heard of OpenLiteSpeed, not because it’s bad, but because it’s not widely used and not yet popular. There are many good things that have been written about OpenLiteSpeed, and if you want to test it yourself, continue below.

OpenLiteSpeed is an open source web server developed by LiteSpeed Technology. It is designed to be lightweight, and comes with an admin panel to manage the server easily from your favorite web browsers.

If you want to run your WordPress website on OpenLiteSpeed instead of Apache or Nginx, continue below to learn how to install it and run WordPress.

How to install OpenLiteSpeed on Ubuntu Linux

We have written a post about installing OpenLiteSpeed on Ubuntu Linux. Before installing WordPress, click on the link below to install OpenLiteSpeed.

This post below shows you how to install OpenLiteSpeed, the latest PHP version and MariaDB database server. Those three components are required to run WordPress.

How to Install OpenLiteSpeed on Ubuntu Linux – Website for Students

After installing OpenLiteSpeed, continue below.

How to download WordPress on Ubuntu Linux for OpenLiteSpeed

Now that OpenLiteSpeed is installed, go and download package to install. Run the commands below to download the latest version of WordPress.

cd /tmp
tar -zxvf latest.tar.gz

After extracting the WordPress archive, move the WordPress content into OpenLiteSpeed default VirtualHost directory.

sudo mv /tmp/wordpress /usr/local/lsws/Example/wordpress

Next, run the commands below to change the permissions of the WordPress folder to run on OpenLiteSpeed.

sudo chown -R nobody:nogroup /usr/local/lsws/Example/wordpress/
sudo chmod -R 755 /usr/local/lsws/Example/wordpress/

How to create WordPress database on Ubuntu

At this point, we’re ready to create WordPress database. As mentioned above, WordPress uses databases to store its content.

To create a database for WordPress, run the commands below:

sudo mysql -u root -p

Then create a database called wpdb


Next, create a database user called wpdbuser and set password

CREATE USER 'wpdbuser'@'localhost' IDENTIFIED BY 'new_password_here';

Then grant the user full access to the database.

GRANT ALL ON wpdb.* TO 'wpdbuser'@'localhost' WITH GRANT OPTION;

Finally, save your changes and exit.


How to configure OpenLiteSpeed to support WordPress

Next, logon to OpenLiteSpeed admin panel to configure WordPress settings.

Login using the admin login details above.

After logging on, go to the Virtual Hosts ==> General tab and edit the Document Root location section.

Then edit the Document Root to point to the WordPress folder created above.


On the same General tab, edit the Index Files section and replace index.html with index.php shown below.


Next, go to Virtual Hosts ==> Rweire Rules, edit Rewrite Control, then choose Yes to enable rewrite.

Save your change.

Next, under Virtual Hosts ==> Rewrite, edit the Rewrite Rules. Copy and paste the lines below into the rules box, save.

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

After making all the changes above, reload OpenLiteSpeed.

Finally, open your web browser and browse to the server hostname or IP address.

A WordPress setup wizard should appear. Follow the wizard to complete the setup.

WordPress Ubuntu Installation

You will need to know the following items before proceeding. Use the database connection info you created above.

  • Database name
  • Database username
  • Database password
  • Database host
  • Table prefix (if you want to run more than one WordPress in a single database)

The wizard will use the database information to create a wp-config.php file in WordPress root folder.

If for any reason this automatic file creation doesn’t work, don’t worry… All this does is fill in the database information to a configuration file. You may also simply open wp-config-sample.php in a text editor, fill in your information, and save it as wp-config.php.

WordPress Ubuntu Installation

Next, type in the database connection info and click Submit

WordPress Ubuntu Installation

After that, click Run the installation button to have WordPress complete the setup…

WordPress Ubuntu Installation

Next, create the WordPress site name and the backend admin account, then click Install WordPress

WordPress installation on Ubuntu

When you’re done, WordPress should be installed and ready to use.

WordPress Ubuntu install

That should do it!


This post showed you how to install WordPress on Ubuntu Linux with OpenLiteSpeed web server. If you find any error above or have something to add, please use the comment form below.