YouTrack Server 2022.1 Help

Install YouTrack JAR as a Service on Linux

The instructions that are provided in this setup guide have been used by the JetBrains development team to install and run YouTrack JAR in a Linux environment.

Prerequisites

To perform this installation, verify that the following prerequisites are met:

  • You have installed Oracle Java SE Runtime Environment 8 or later. The instructions here require that the JRE is available from the path /usr/bin/java.

  • Any external hostname (proxy hostname) is resolvable from the actual host where YouTrack is installed.

Installation

The following procedure describes how to install and run YouTrack JAR as a service on Linux or another *nix-like operating system.

To install the YouTrack JAR distribution as a service on Linux:

  1. Create a user account to run the YouTrack service. For example, youtrack. The youtrack user account manages YouTrack data and services.

    adduser youtrack --disabled-password
  2. Use the following command to download the latest version of the JAR distribution:

    wget -O /home/youtrack/youtrack.jar https://download.jetbrains.com/charisma/youtrack-<version>.jar

    Replace the <version> with the current version number and build number. For example, 2018.2.41826.

    You can find the current version and build on the download page for YouTrack Server. Alternatively, you can download the JAR file manually and save it under /home/youtrack/youtrack.jar.

  3. Set the permissions for the JAR file with the following command:

    chown youtrack:youtrack /home/youtrack/youtrack.jar
  4. Create a systemd service file in the following directory: /etc/systemd/system/youtrack.service

    Paste the following content into the youtrack.service file:

    [Unit] Description=Youtrack Requires=network.target After=syslog.target network.target [Service] Type=simple WorkingDirectory=/home/youtrack ExecStart=/usr/bin/java -jar /home/youtrack/youtrack.jar --J-Xmx1G 8080 ExecStop=/usr/bin/java -jar /home/youtrack/youtrack.jar stop User=youtrack [Install] WantedBy=default.target

    Customize the content of the file as needed:

    • If you want YouTrack to start on a different port number, edit the default port 8080.

    • Add and modify other Java parameters as needed.

  5. Use the following command to reload the systemd daemon and enable the YouTrack service on system start:

    systemctl daemon-reload systemctl enable youtrack.service
  6. Enter the following command to run the YouTrack service:

    service youtrack start
  7. Open http://<your-host-name>:8080 in a web browser and wait for the application to become available. As it takes some time to start the application, the port may be unreachable for a short while.

After installation, you can set up YouTrack to run behind a reverse proxy server. For instructions, see Reverse Proxy Configuration.

Upgrade

When you have installed the JAR distribution as described above, upgrading to a later version is relatively simple. All you need to do is:

  • Remove the previous version of the JAR file.

  • Download the latest version.

  • Set permissions for the file.

  • Restart the service.

All of this can be done by executing the following commands:

mv /home/youtrack/youtrack.jar /home/youtrack/youtrack-old.jar wget -O /home/youtrack/youtrack.jar https://download.jetbrains.com/charisma/youtrack-<version>.jar chown youtrack:youtrack /home/youtrack/youtrack.jar service youtrack restart
Last modified: 06 July 2022