Hub 2017.4 Help

Stop and Start the Hub Service

This page describes how to stop and start your Hub server.

The following situations require that you stop your Hub server:

  • You want to change the location of the Hub database.
  • You want to modify Hub properties or JVM options for your Hub server.
  • You want to upgrade your Hub installation.

Stop and Start an MSI Installation

When you install Hub with an MSI distribution, Hub runs as a Windows service. The display name of the windows service is JetBrains Hub. After the initial configuration, the application runs in the background on the server.

To start and stop the Windows service, use the Services Microsoft Management Console (MMC) (Control Panel > Administrative Tools > Services).

Stop and Start a ZIP Installation

If you installed Hub with a ZIP distribution, you run Hub from the command line. The scripts that you use to start and stop Hub are located in the <hub_home>/bin/ directory. The <hub_home> directory is the location where the ZIP distribution was unpacked during installation.

To stop and start Hub on OS X or Linux platforms, execute the command as a non-root user.

Enter commands to stop and start the Hub service in a command-line interface. Use the following commands to manage the status of your Hub instance:

CommandDescription
hub.sh start Start the Hub service.
hub.sh stop Stops the Hub service.
hub.sh restart Restarts the Hub service.
hub.sh help Displays a list of all commands that can be executed in the command-line interface.

Stop and Run a Docker Container

Run Hub docker container

To run Hub container, execute the command:

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

Command attributes:

  • -it — a flag that attaches Hub 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 hub-server-instance — the arbitrary name for the container.
  • -v <path to NNN directory>:/opt/hub/NNN — binding the Hub-specific 'NNN' directory on the host machine to the respective /opt/hub/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.

Stop Hub docker container

To stop the Hub 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 Hub process inside the Docker container, then waits for 10 seconds. If Hub does not finish the shutdown within that time period, the `SIGKILL` is sent to the kernel and the Hub 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 Hub service to shut down:

docker stop -t 60 <containerId>
Last modified: 7 December 2017