Run Confluence as a systemd service on linux
This article explains how to install Confluence as a systemd service in linux.
- You already have Confluence installed and working, but you need it to function as a service (i.e. start on boot).
- Your existing Confluence installation is running under a user other than root (we'll assume the user is named 'confluence').
- Login to the machine and elevate to the root user
Create the following service config as root:
touch /lib/systemd/system/confluence.service chmod 664 /lib/systemd/system/confluence.service
Edit the service config as root
Define the service config by putting this into confluence.service
[Unit] Description=Confluence After=network.target [Service] ExecStart=/bin/su confluence /opt/atlassian-confluence/bin/start-confluence.sh [Install] WantedBy=multi-user.target
Note: The above defined 'confluence' in the ExecStart line is the user under which you need to run Confluence. The name of this user may vary in your environment.
Enable and start the service as root
systemctl daemon-reload systemctl enable confluence.service systemctl start confluence.service