Run and Stop a Docker Container
This page describes how to stop and start your YouTrack Standalone 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 Standalone server.
You want to upgrade your YouTrack Standalone installation.
Run YouTrack docker container
To run YouTrack container, execute the 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>
-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/NNNdirectory 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
8080inside the docker container.
Stop YouTrack 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 --signal=SIGTERM <containerId>` command.
We do not recommend using the standard command `
docker stop`. By default, this command sends the `
SIGTERM` signal to the YouTrack process inside the Docker container, then waits for 10 seconds. If YouTrack does not finish the shutdown within that time period, the `
SIGKILL` is sent to the kernel and the YouTrack process is killed. 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 YouTrack service to shut down:
docker stop -t 60 <containerId>