Running midPoint with systemd

Last modified 27 Jun 2025 10:39 +02:00

This page describes how to set up midPoint server for systemd run control. This is the usual setup to start midPoint automatically after a system boot on UNIX-like (Linux) systems.

In the instructions on this page, a static definition of the systemd service is used. If you want to generate the systemd service customized to your environment, you can use the following feature of midpoint.sh:

/opt/midpoint/bin/midpoint.sh generate

The following steps assume the midPoint installation in the /opt/midpoint directory. Both the directory and its content are owned by the previously created user midpoint. The service will be started as the user midpoint and will listen on the default TCP port 8080.

Start midPoint Service

To start midPoint as a systemd service:

  1. Create a new /etc/systemd/system/midpoint.service file with the following content:

    midpoint.service
    [Unit]
    Description=MidPoint Standalone Service
    ###Requires=postgresql.service
    ###After=postgresql.service
    [Service]
    User=midpoint
    WorkingDirectory=/opt/midpoint
    ExecStart=/usr/bin/java -Xmx2048m -Dmidpoint.home=/opt/midpoint/var -jar /opt/midpoint/lib/midpoint.jar
    SuccessExitStatus=143
    ###TimeoutStopSec=120s
    [Install]
    WantedBy=multi-user.target

    For larger deployments, modify -Xmx2048m accordingly.

    If you wish to customize JVM parameters, modify the ExecStart directive in the midpoint.service file and restart midPoint.

    If you are installing a version older than 4.6, you need to change the file extension in the ExecStart line from JAR to WAR as those versions use a different packaging method.

    ExecStart=/usr/bin/java -Xmx2048m -Dmidpoint.home=/opt/midpoint/var -jar /opt/midpoint/lib/midpoint.war
  2. Run the following commands to enable the midPoint service:

    sudo systemctl daemon-reload
    sudo systemctl enable midpoint
  3. Start midPoint as a systemd service using the following command:

    sudo systemctl start midpoint

You can specify service dependencies with systemd. For example, to specify that midPoint requires a PostgreSQL database (running as a systemd service on the same host), uncomment the lines Requires and After. systemd will then start PostgreSQL before midPoint, and when PostgreSQL goes down, it will also automatically shutdown midPoint.

Stop midPoint Service

You can stop midPoint as a systemd service using the following command:

sudo systemctl stop midpoint

To disable automatic midPoint startup/shutdown, use the following command:

sudo systemctl disable midpoint

Monitor midPoint

You can monitor the startup in:

  • /opt/midpoint/var/log/midpoint.log - The standard midPoint log.

  • /var/log/syslog - The system log file. Its name and location depends on the system in which you are running midPoint.

When using systemd, the /opt/midpoint/var/log/midpoint.out log file, which would otherwise capture the standard output of the midPoint process, is not used.

Was this page helpful?
YES NO
Thanks for your feedback