Install Lightstreamer Inside Docker Container in Linux

Install Lightstreamer Inside Docker Container in Linux

Lightstreamer is a messaging server to stream data for web and mobile applications. Lightstreamer offers in-app messaging, push notifications and publish/subscribe messaging.

This tutorial explains how to install Lightstreamer inside a Docker container in the Linux. Commands have been tested on Ubuntu.

Prepare environment

Make sure you have installed Docker in your system. If you are using Ubuntu, installation instructions can be found in the post.

Install Lightstreamer

  • Host network

Run the following command to create a container for Lightstreamer that uses host network:

docker run -t -d --name=lightstreamer --restart=always --network=host \
    -v /opt/lightstreamer/logs:/lightstreamer/logs \
    lightstreamer
  • User-defined bridge network

User-defined bridge network can be used for listening on different port. By default, Lightstreamer service is listening on port 8080. It can be changed with -p option.

docker network create app-net
docker run -t -d --name=lightstreamer --restart=always --network=app-net \
    -p 8081:8080 \
    -v /opt/lightstreamer/logs:/lightstreamer/logs \
    lightstreamer

Testing Lightstreamer

Open a web browser and go to http://<IP_ADDRESS>:8080, where <IP_ADDRESS> is the IP address of the system. You will see the welcome page that demonstrates the demo application.

Lightstreamer Inside Docker Container in Linux

Uninstall Lightstreamer

To completely remove Lightstreamer, remove its container:

docker rm --force lightstreamer

Remove Lightstreamer image:

docker rmi lightstreamer

You can also remove Lightstreamer logs:

sudo rm -rf /opt/lightstreamer

If a user-defined bridge network was created, you can delete it as follows:

docker network rm app-net

Leave a Comment

Cancel reply

Your email address will not be published.