LiteSpeed Offers Docker Solutions
Docker is more popular than ever these days, and this year LiteSpeed Technologies has introduced Docker images for both LiteSpeed Enterprise and OpenLiteSpeed web servers, as well as a WordPress App bundle. With LiteSpeed Docker solutions, you can easily set up High Performance WordPress with HTTP/3 protocol support, and developers can run it on multiple platforms like Linux or Windows.
We have made LiteSpeed Enterprise and OpenLiteSpeed Images available on Docker Hub, along with WordPress bundle solutions which are based on each of them.
You can deploy any of the LiteSpeed images on Docker in less than a minute.
Here we’ll use OpenLiteSpeed as an example, and assume you already have Docker installed.
Download the Image from Docker Hub
docker pull litespeedtech/openlitespeed:latest
Start a Container
docker run -d --name openlitespeed -p 7080:7080 -p 80:80 -p 443:443 -it litespeedtech/openlitespeed:latest
TIP: You can eliminate
-p 7080:7080 from the command if you don’t need WebAdmin access.
Add a sample page
The server should start running successfully, and you should be able to log into the container. Add some files you want to display with the following command:
docker exec -it openlitespeed bash
WORKDIR should be
/var/www/vhosts/, since the default document root path is
/var/www/vhosts/localhost/html. Simply add the following command to
index.php, then we can verify it from the browser with a public server IP address on both HTTP and HTTPS.
echo '<?php phpinfo();' > localhost/html/index.php
Deploy High-Performance WordPress with LiteSpeed
To start a high-performance WordPress-with-LiteSpeed-Cache solution, you can choose to use one of the following containers:
Download the Open Source from GitHub
Clone this repository or copy the files from this repository into a new folder:
git clone https://github.com/litespeedtech/ols-docker-env.git
Change the Default Values (Optional)
.env file to update the demo site domain, default MySQL user, and password. Feel free to check the Docker Hub Tag page if you want to update the default LiteSpeed Enterprise, OpenLiteSpeed, or PHP versions.
Start the Multicontainer
Open a terminal,
cd to the folder in which
docker-compose.yml is saved, and run:
docker-compose up -d
Start Your First WordPress site
After running the following command, you should be able to access the WordPress installation page with the configured domain. If there is no change in the
.env file, then the default domain is https://localhost.
For more CLI usage information please check our documentation which covers:
- Setting the WebAdmin Password
- Creating a Domain and Virtual Host
- Creating a Database
- Installing a WordPress Site
- Applying a Let’s Encrypt Certificate
- Updating the Web Server
- Applying OWASP ModSecurity
- OpenLiteSpeed Docker One-Click Installation Part 1/2
- OpenLiteSpeed Docker One-Click Installation Part 2/2
Build Your Own Web Server Version
Sometimes you may want to install more packages from the default image, or some other web server or PHP version which is not officially provided. You can build an image based on an existing image. Here’s how:
- Download the dockerfile project
- CD into the project directory
- Edit the Dockerfile here if necessary
- Build, feeling free to substitute server and PHP versions to fit your needs
git clone https://github.com/litespeedtech/lsws-dockerfiles.git cd lsws-dockerfiles/template bash build.sh -L 5.4.4 -P lsphp72
git clone https://github.com/litespeedtech/ols-dockerfiles.git cd ols-dockerfiles/template bash build.sh -O 1.6.7 -P lsphp72
Extend Existing Images
If you want to customize the image by adding some packages, e.g.
lsphp74-pspell, just extend it with a Dockerfile:
FROM litespeedtech/openlitespeed:latest RUN apt-get update && apt-get install lsphp74-pspell
LiteSpeed Docker solutions allow you to start a pure LSWS or OLS web server on Docker or start WP + LiteSpeed Docker easily. You can also customize or extend the image whenever you need to. Our Docker solutions are still in a very early release stage, so feel free to raise an issue if you have any suggestions or problems. Contributions are always welcome.
Special thanks to our friend Lars Hagen. Lars is a DevOps enthusiast, with a passion for Docker and everything in the cloud. He helped us lay out the foundation for building good, robust Docker images, which is why we now have these high-end Docker images to support and use today.