YouTrack Server 2024.1 Help

Stop and Restart a Docker Container

This page describes how to stop and start your YouTrack Server server.

The following situations require that you stop YouTrack:

  • You want to change the location of the database.

  • You want to modify properties or JVM options for your YouTrack Server server.

  • You want to upgrade your YouTrack Server installation.

Stop a Docker container

To stop the YouTrack service gracefully, run the command:

docker exec <containerId> stop

For a graceful shutdown, you can also use the standard docker kill command:

docker kill --signal=SIGTERM <containerId>

We do not recommend using the standard command docker stop. By default, this command sends the SIGTERM signal to the Hub process inside the Docker container, then waits for 10 seconds. If Hub does not shut down completely within that time period, the SIGKILL is sent to the kernel, immediately terminating the Hub process. This may lead to data corruption. To avoid this outcome, specify an appropriate timeout value when using this command. For example, the following command leaves enough time for the Hub service to shut down:

docker stop -t 60 <containerId>

Start YouTrack with a Docker Container

To run a YouTrack container, enter the following command:

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>
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>

Command attributes:

  • -it a command-line flag that attaches both the input and output of the container to your terminal. This lets you see the output produced by the container as if it were running directly in your terminal.

    When the container starts, you will see the log messages generated during the initialization process as well.

    Pressing Ctrl+ C while the terminal is attached to a container's output sends an interrupt signal to the container's running process. This is similar to how you would stop a regular process in your terminal. This command causes the container to shut down, so be cautious when using Ctrl+ C in this context.

    If you want to detach the terminal from the container output without interrupting the processes running in it, press Ctrl+ P followed by Ctrl+ Q.

    For more details, please refer to the the official docker documentation.

  • --name hub-server-instance this is an arbitrary name for the container.

    By default, Docker generates random and sometimes cryptic names for containers. Use the --name option to give your container a more meaningful and human-readable name that makes it easier to identify and manage.

  • -v <path to <name> directory>:/opt/hub/<name> these options specify the location of the storage provisioned on the host machine and maps them to the corresponding /opt/hub/<name> directories inside the container.

  • -p <port on host>:8080 parameter that defines the port mapping. This tells the host machine to listen for traffic on the <port on host> port and propagate all traffic to port 8080 inside the container.

Last modified: 08 April 2024