YouTrack Standalone 2019.3 Help

Docker Installation

To run a new instance of the YouTrack service in a docker container:

  1. Pull YouTrack Image
  2. Create and Configure Directories
  3. Run YouTrack Docker Container
  4. Configure YouTrack

Pull YouTrack Image

Pull an image of the latest YouTrack version from the Docker YouTrack Repository:

docker pull jetbrains/youtrack:<version>

<version> is a full version number of a YouTrack build. See the complete list of available versions.

Create and Configure Directories

YouTrack image container is a stateful container. Thus, before running it, you should create specific directories on the host machine to store YouTrack database, configuration files, logs, backups, and pass them to the YouTrack container as volumes. Otherwise, you risk losing YouTrack data when the container is removed.

These directories are:

  • data — a directory where YouTrack stores its database. For a new installation, this directory must be empty.

  • conf — a directory where YouTrack stores configuration files that contain environment settings, JVM options, YouTrack integration settings, and so on.

  • logs — a directory where YouTrack stores its log files.

  • backups — a directory where YouTrack stores backups. For more details about backups, see Back Up the Database.

YouTrack-specific directories on a Linux host machine:

These directories must be accessible to the user account that is used to run YouTrack service inside the container. If your host machine is run under *nix OS, YouTrack uses the non-root account `13001:13001` (`group:id`, respectively).

For example, you can execute the following commands to create YouTrack directories and apply the required access permissions:

mkdir -p -m 750 <path to data directory> <path to logs directory> <path to conf directory> <path to backups directory> chown -R 13001:13001 <path to data directory> <path to logs directory> <path to conf directory> <path to backups directory>

When YouTrack-specific directories are created and configured, you can define the mapping between them and directories inside the docker container as the arguments of the docker run command.

YouTrack-specific directories on another OS host machine:

These directories must be accessible to the user account that is used to run YouTrack service inside the container.

For example, you can run the following command under the same user account that runs the Docker container:

mkdir -p -m 750 <path to data directory> <path to logs directory> <path to conf directory> <path to backups directory>

When YouTrack-specific directories are created and configured, you can define the mapping between them and directories inside the docker container as the arguments of the docker run command.

Run YouTrack Docker Container

Use the following command to run a container with YouTrack service and map YouTrack data volumes and port:

docker run -it --name <youtrack-server-instance> \ -v <path to data directory>:/opt/youtrack/data \ -v <path to conf directory>:/opt/youtrack/conf \ -v <path to logs directory>:/opt/youtrack/logs \ -v <path to backups directory>:/opt/youtrack/backups \ -p <port on host>:8080 \ jetbrains/youtrack:<version>

Where:

  • -it — a flag that attaches YouTrack container input and output including the startup logs to the terminal window. Note that pressing `Ctrl+C` when the terminal is attached to a container output causes the container to shut down. Use `Ctrl+PQ` in order to detach the terminal from container output. For more details, see the official docker documentation.

  • --name youtrack-server-instance — the arbitrary name for the container.

  • -v <path to NNN directory>:/opt/youtrack/NNN — binding the YouTrack-specific 'NNN' directory on the host machine to the respective /opt/youtrack/NNN directory inside the container.

  • -p <port on host>:8080 — parameter that defines the ports mapping. It instructs the host machine to listen on port <port on host> and propagate all traffic to the port `8080` inside the docker container.

YouTrack service is started on {0.0.0.0:8080} inside the Docker container, and port 8080 is mapped to <port on host> that you have specified. This way the service may be accessed from any machine that has network access to the <port on host> of your host machine. For instance, if the FQDN of the host machine is host.mydomain.com and the <port on host> is 7777, then the service will be available at http://host.mydomain.com:7777.

Configure YouTrack

On the first run, the YouTrack service starts with the web-based Configuration Wizard at the address mentioned above. Open your browser, enter the address and follow the steps described in Configuration Wizard to complete the setup.

When the YouTrack service is configured and running, log in as the system administrator. Then, open the administration menu > Global Settings page, and set up your timezone. For an empty new installation the time zone is set to UTC, by default.

Configure YouTrack service from the Command Line

For automated installation purposes, you can skip the wizard. However, in this case, the YouTrack service starts with the default parameters. Thus, you need to explicitly set the base URL — the URL at which the YouTrack service is available to the end users.

To skip Configuration Wizard, run the configure command before running YouTrack:

docker run --rm -it -v <path to conf directory>:/opt/youtrack/conf \ -v <path to logs directory>:/opt/youtrack/logs \ jetbrains/youtrack:<version> \ configure \ -J-Ddisable.configuration.wizard.on.clean.install=true \ --base-url=http://youtrack.mydomain.com:XXXX

If you ever need to change the base URL for your running YouTrack instance, we urge you to do it using the Admin menu > Global Settings page of the YouTrack UI. In this case you do not need to stop the service. However, you can also use the configure command with the --base-url argument.

To change the Base URL of the YouTrack service:

  1. Stop YouTrack: docker exec <containerId> stop

  2. Run the following command:

    docker run --rm -it -v <path to conf directory>:/opt/youtrack/conf \ -v <path to logs directory>:/opt/youtrack/logs \ jetbrains/youtrack:<version> \ configure --base-url=https://<YouTrack service baseURL>:XXXX
  3. Start YouTrack: docker start <containerId>

To see all stopped containers, run docker ps -a

Last modified: 16 March 2020