Docker Compose with Docker Volumes

JFrog Installation & Setup Documentation

Content Type
Installation & Setup

This method leverages Docker volumes for data persistence, which is often a good practice for single-node production environments. It is a variation of the manual installation.

  1. Create JFrog Home Directory and Set JFROG_HOME Variable

    1. Create Dedicated Directory:

      Create a dedicated directory for your JFrog installation. This can be any directory of your choice (for example, /app/jfrog, /usr/local/jfrog, or a custom path).

      # Replace <path to your directory> with your chosen directory
      sudo mkdir -p <path to your directory> 
      cd <path to your directory> 
    2. Set JFROG_HOME Variable:

      Set the JFROG_HOME environment variable to easily refer to this path in your terminal. This must match the directory you created in the previous step.

      # Replace <path to your directory> with your chosen directory
      export JFROG_HOME=<path to your directory>
      

    For more information, see JFrog Product Directory Structure.

  2. Download and Extract the Artifactory Docker Compose Archive:

    1. Download the Artifactory Docker Compose Package:

      Download the specific Artifactory Docker Compose package you wish to install. To download a specific version, replace [RELEASE] with the exact version number (for example, 7.111.11) in the command below:

      curl -g -L -O -J 'https://releases.jfrog.io/artifactory/artifactory-<pro|oss|jcr|cpp-ce>/org/artifactory/<pro|oss|jcr|cpp-ce>/docker/jfrog-artifactory-<pro|oss|jcr|cpp-ce>/[RELEASE]/jfrog-artifactory-<pro|oss|jcr|cpp-ce>-[RELEASE]-compose.tar.gz'
      
      # For example, to download Artifactory Pro 7.111.11:
      curl -g -L -O -J 'https://releases.jfrog.io/artifactory/artifactory-pro/org/artifactory/pro/docker/jfrog-artifactory-pro/7.111.11/jfrog-artifactory-pro-7.111.11-compose.tar.gz'
    2. Extract the Archive and Navigate:

      Extract the contents of the downloaded compressed archive (.tar.gz file) and then navigate into the extracted folder.

      tar -xvf jfrog-artifactory-<pro|oss|jcr|cpp-ce>-<version>-compose.tar.gz
      # Example:
      # tar -xvf jfrog-artifactory-pro-7.111.11-compose.tar.gz
      # Navigate into the extracted folder
      cd artifactory-<pro|oss|jcr|cpp-ce>-<version>/

    Note

    An .env file is included within the Docker Compose archive. This file is used by Docker Compose and is updated during installations and upgrades. Some operating systems do not display dot files by default. If you make any changes to this file, remember to back it up before an upgrade.

  3. Create Docker Volumes and Configure Docker Compose

    1. Create Docker Volumes:

      Create named Docker volumes to manage Artifactory's data and, if applicable, the PostgreSQL data.

      docker volume create --name=artifactory_data
      
      # Only if using PostgreSQL managed by Docker Compose
      docker volume create --name=postgres_data 
    2. Copy Docker Compose Volume Template:

      Copy the docker-compose-volumes.yaml template to your current extracted directory and rename it to docker-compose.yaml.

      cp templates/docker-compose-volumes.yaml docker-compose.yaml
    3. Update the .env File:

      Add entries to the .env file for node identification. Avoid adding duplicate entries.

      echo -e "JF_SHARED_NODE_IP=$(hostname -i)" >> .env
      echo -e "JF_SHARED_NODE_ID=$(hostname -s)" >> .env
      echo -e "JF_SHARED_NODE_NAME=$(hostname -s)" >> .env
  4. Follow the steps mentioned in Docker Compose Next Steps to complete the setup.