Upgrade with Docker
This page describes scenarios of upgrading an existing Hub service with the Hub docker image.
Upgrade a Docker Image
Create a backup of the Hub database while your existing Hub installation is running.
- Pull an image of the latest Hub version from the Docker Hub Repository:
docker pull jetbrains/hub:<version>
Where <version> is a full version number of an Hub build. See the complete list of available verions.
- Execute the following command to run a container with the new Hub version, that you have pulled from the repository. All other attributes of the command (volumes and port mappings) must be the same as those that you used with the previous version of the Hub image:
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:<new version>
In the console, an URL to the web-based configuration wizard is displayed.
Open the URL in a browser. The settings from the current database are displayed:
Review the settings, and click the Upgrade button.
The Hub service starts with the updated Hub version.
Upgrade a ZIP or MSI Installation with Docker Image
Create a backup of the Hub database while your existing Hub installation is running.
- Pull an image of the latest Hub version from the Docker Hub Repository:
docker pull jetbrains/hub:<version>
Where <version> is a full version number of an Hub build.
- Create and configure Hub-specific directories on the host machine.
Copy the backup file of the Hub database into the
backups
directory, that you created in the previous step.- Execute the following command to run a container with Hub server and map Hub data volumes and port:
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>
Attributes used with the command:
-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.
{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 <port on host> of the host machine. For instance, if FQDN of the host machine is host.mydomain.com and the <port on host> is 7777, then the service is available at http://host.mydomain.com:7777 The Hub service starts with the web-based Configuration Wizard at the address mentioned above (in our example, it is
http://host.mydomain.com:7777
). Open the URL in a browser to access the wizard.In the Configuration Wizard, click Upgrade.
On the Select Upgrade Source page, click the Select button and select the backup file as an upgrade source. Click Next.
On the Confirm Settings page, review the system settings.
- When done, click Upgrade.
- Hub launches its components.
Do not close the page in the browser until the setup is complete. When the Hub server is ready, you are redirected to the login page.
- Hub launches its components.
- Enter the credentials for the Hub administrator account and click the Log in button.
Hub opens to the Users page.
Your Hub installation is upgraded and ready to use.