Liferay Forums docs

Home/Marketplace Apps/Liferay Forums/Installing

Installing on Liferay Self-Hosted (Docker)

Liferay and PostgreSQL run in containers, and the forum’s microservice runs in a third container that shares Liferay’s network, so Liferay reaches it at localhost:58081 as on a server. You copy the forum’s zips into the running Liferay container, in the same order as on a server. These steps were tested with the liferay/dxp:2026.q1.4-lts image.

You need Docker. Run the commands from a folder that holds the release’s three zips, downloaded from the latest release.

  1. Step 1: Add the Liferay Fixes
  2. Step 2: Start PostgreSQL and Liferay
  3. Step 3: Deploy the Batch
  4. Step 4: Deploy the Microservice’s Zip
  5. Step 5: Start the Microservice
  6. Step 6: Set Up Email Notifications
  7. Step 7: Create the Forum Sites
  8. Day to Day
  9. Related Information

Step 1: Add the Liferay Fixes

Create a folder named patching next to the zips, and put the hotfix from Liferay Support in it. Liferay installs it each time its container starts. Without a hotfix, leave the folder empty, and use the workarounds.

Step 2: Start PostgreSQL and Liferay

  1. Create a network for the containers, and start PostgreSQL. Replace change-me with a password of your own, here and in the next command:

     docker network create forums
     docker run -d --name forums-postgres --network forums --restart unless-stopped \
       -e POSTGRES_DB=lportal -e POSTGRES_USER=liferay -e POSTGRES_PASSWORD=change-me \
       -v forums-postgres-data:/var/lib/postgresql/data \
       postgres:16.15
    
  2. Start Liferay. The forums-liferay-routes volume holds the credentials Liferay writes for the microservice:

     docker run -d --name forums-liferay --network forums -p 8080:8080 --restart unless-stopped \
       -e LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_DRIVER_UPPERCASEC_LASS_UPPERCASEN_AME=org.postgresql.Driver \
       -e LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_URL=jdbc:postgresql://forums-postgres:5432/lportal \
       -e LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_USERNAME=liferay \
       -e LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_PASSWORD=change-me \
       -v forums-liferay-data:/opt/liferay/data \
       -v forums-liferay-routes:/opt/liferay/routes \
       -v "$PWD/patching:/mnt/liferay/patching" \
       liferay/dxp:2026.q1.4-lts
    
  3. Wait until Liferay has started: docker logs forums-liferay shows Server startup in. This takes a few minutes. Liferay is then at http://localhost:8080.

Step 3: Deploy the Batch

  1. Copy the batch into the running container:

     docker cp liferay-forums-batch.zip forums-liferay:/opt/liferay/osgi/client-extensions/
    
  2. Follow the log, and wait until it shows five lines containing Finished batch engine import task after the copy, then press Ctrl+C:

     docker logs -f --since 2m forums-liferay | grep "Finished batch engine import task"
    

Liferay also logs a few of these lines while it starts. Only count the ones after the copy, and don’t continue until all five have finished.

Step 4: Deploy the Microservice’s Zip

docker cp liferay-forums-etc-spring-boot.zip forums-liferay:/opt/liferay/osgi/client-extensions/

Wait until docker logs forums-liferay shows STARTED liferayforumsetcspringboot.

Step 5: Start the Microservice

  1. Build the microservice’s image from the Dockerfile in its zip:

     mkdir microservice
     unzip liferay-forums-etc-spring-boot.zip -d microservice
     docker build -t liferay-forums-microservice microservice
    
  2. Start it in Liferay’s network, with Liferay’s credentials volume:

     docker run -d --name forums-microservice --network container:forums-liferay --restart unless-stopped \
       -v forums-liferay-routes:/opt/liferay/routes:ro \
       -e LIFERAY_ROUTES_CLIENT_EXTENSION=/opt/liferay/routes/default/liferay-forums-etc-spring-boot \
       -e LIFERAY_ROUTES_DXP=/opt/liferay/routes/default/dxp \
       liferay-forums-microservice
    
  3. Check that Liferay reaches it. This prints READY:

     docker exec forums-liferay curl -s http://localhost:58081/ready
    

Step 6: Set Up Email Notifications

The batch created two email templates with a placeholder sender address. Set real addresses, then restart the microservice with docker restart forums-microservice, before members get email. See Email Notifications.

Step 7: Create the Forum Sites

Continue with Creating Forum Sites.

Day to Day

  • After Liferay’s container restarts, restart the microservice’s container too, since it shares Liferay’s network: docker restart forums-microservice.
  • The zips live in Liferay’s container. If you remove the container and start a new one, for example to change a setting or the image, the new container has none of the forum’s zips. Copy in the batch, then the microservice’s zip, as in Steps 3 and 4. Then remove the microservice’s container and start it again with the docker run command of Step 5: it was tied to the old Liferay container, so restarting it fails.

      docker rm -f forums-microservice
    
  • Logs: docker logs forums-liferay and docker logs forums-microservice.