I'm learning / testing about Docker and would like to run OLS as a container. I'm using Ubuntu 24 LTS with Docker 29.02.
If I run this command the container starts and I can get to the Webadmin page on port 7080
However, when I try to start OLS via docker compose, I can't access anything and
shows the error:
The OLS section of my compose file is below. I've based it on the OLS Env Github example
I'm obviously missing something but I don't know what to check next. If it helps, the project is under /opt/docker/dockertest - could it be permissions related? However ./logs/lsrestart.log is being written to:
Thank you in advance!
{Edit}
I've just had a thought that as I'm mapping in the volumes for conf, sites etc via docker compose, the conf folders are empty and thus I now think that is why OLS can't start (as these exist when running the image "directly"). However, if you are starting with a docker image from scratch (with mounted volumes), how do you start the image to configure it? Something of a chicken and egg situation...
If I run this command the container starts and I can get to the Webadmin page on port 7080
Code:
docker run --name openlitespeed -d -p 7080:7080 -p 80:80 -p 443:443 -it litespeedtech/openlitespeed:1.8.4-lsphp84
Code:
docker logs litespeed
Code:
Can't determine the Home of LiteSpeed Web Server, exit!
[ERROR] Failed to start litespeed!
Code:
litespeed:
image: "litespeedtech/openlitespeed:${OLS_VERSION}-${PHP_VERSION}"
restart: unless-stopped
container_name: litespeed
env_file:
- .env
volumes:
- ./lsws/conf:/usr/local/lsws/conf
- ./lsws/admin-conf:/usr/local/lsws/admin/conf
- ./sites:/var/www/vhosts/
- ./logs:/usr/local/lsws/logs/
environment:
TZ: ${TimeZone}
networks:
- public
- private
Code:
Thu Nov 27 21:53:04 GMT 2025
start, LSWS running: 0
LSWS does not restart properly, check port 7080
check port 7080 after kill all litespeed processes
Thu Nov 27 21:53:21 GMT 2025
status, LSWS running: 0
Thu Nov 27 21:53:22 GMT 2025
start, LSWS running: 0
LSWS does not restart properly, check port 7080
check port 7080 after kill all litespeed processes
Thu Nov 27 21:53:39 GMT 2025
status, LSWS running: 0
Thu Nov 27 21:53:39 GMT 2025
start, LSWS running: 0
LSWS does not restart properly, check port 7080
check port 7080 after kill all litespeed processes
Thu Nov 27 21:53:56 GMT 2025
status, LSWS running: 0
Thu Nov 27 21:53:56 GMT 2025
start, LSWS running: 0
{Edit}
I've just had a thought that as I'm mapping in the volumes for conf, sites etc via docker compose, the conf folders are empty and thus I now think that is why OLS can't start (as these exist when running the image "directly"). However, if you are starting with a docker image from scratch (with mounted volumes), how do you start the image to configure it? Something of a chicken and egg situation...