Installing Artifactory with Docker involves running Artifactory within a container, providing a highly portable and consistent deployment. This method is suitable for both single-node setups and high-availability (HA) configurations.
Here you'll find step-by-step instructions for installing JFrog Artifactory using Docker commands, covering both single-node and high-availability (HA) configurations.
Prerequisites
Confirm your OS is a JFrog-supported OS.
Ensure that your environment meets the minimum resource requirements, as Artifactory's setup depends on active clients and usage.
Configure your network to meet JFrog's network requirements.
Docker Engine (version 20.10.10 and above) must be installed and properly configured on your host machine(s).
For additional prerequisites like Java requirements, supported browsers, and so on, see:
Install Artifactory Docker Containers
Throughout these installation steps, you must have sudo privileges or be the root user for system-level operations, package installations, and file modifications. This ensures that Artifactory can be installed correctly.
The following steps cover the installation process for both single-node and HA:
Set
JFROG_HOMEVariable and Create DirectoriesSet the
JFROG_HOMEdirectory:Run the following command to define the
JFROG_HOMEenvironment variable, pointing to the base directory where Artifactory's data (varfolder) will reside on the host machine.export JFROG_HOME=<path of your directory>
For example: export
JFROG_HOME=/opt/jfrog. For more information, see JFrog Product Directory Structure.Create
system.yamland Set Permissions:In your defined
JFROG_HOMEdirectory, create the necessary Artifactory directory structure, including an emptysystem.yamlfile, and set the required ownership. The user creating the folder should be the user running the Docker command.mkdir -p $JFROG_HOME/artifactory/var/etc/ cd $JFROG_HOME/artifactory/var/etc/ touch ./system.yaml sudo chown -R 1030:1030 $JFROG_HOME/artifactory/var
If you are using Docker on a Mac machine, run the following additional command to ensure proper permissions:
sudo chmod -R 777 $JFROG_HOME/artifactory/var
Set up Artifactory Database
Artifactory requires an external database for production. JFrog highly recommends using PostgreSQL for all products in the JFrog Platform, although Artifactory supports additional databases. For more information, see Database Configuration.
For Non-Production (Optional: PostgreSQL Container):
For a non-production environment, you can start a PostgreSQL container on the same machine as your Artifactory container:
docker run --name postgres -itd -e POSTGRES_USER=artifactory -e POSTGRES_PASSWORD=password -e POSTGRES_DB=artifactorydb -p 5432:5432 library/postgres:<version> # Example: # docker run --name postgres -itd -e POSTGRES_USER=artifactory -e POSTGRES_PASSWORD=password -e POSTGRES_DB=artifactorydb -p 5432:5432 library/postgres:16.8
For Production (External Database) and Configuration:
For production environments, connect to an external database. On each Artifactory node, configure the
system.yamlfile with the database configuration details.shared: database: driver: org.postgresql.Driver type: postgresql url: jdbc:postgresql://host.docker.internal:5432/artifactorydb username: artifactory password: passwordThe database connection URL may vary depending on the Container Engine in use (for example,
host.docker.internalfor Docker Desktop, actual IP for remote DB or Docker on Linux). Please ensure you are using the correct URL for your specific environment.Configure Other Supported Databases (Optional):
To utilize databases other than PostgreSQL, you'll need to set
shared.database.allowNonPostgresqltotruein yoursystem.yamland configure the database details. Here's an example for MySQL:shared: database: allowNonPostgresql: true type: mysql driver: com.mysql.jdbc.Driver url: jdbc:mysql://<your db url, for example: localhost:3306>/artdb?characterEncoding=UTF-8&elideSetAutoCommits=true&useSSL=false username: artifactory password: password
For more information about creating and configuring databases, see Set up Database.
Configure Host ID and IP for Container Installations:
For Podman and other Container Installations, verify that the host's ID (
shared.node.id) and IP (shared.node.ip) are explicitly added to thesystem.yaml. If these are not manually added, they are automatically resolved as the container's IP, meaning other nodes and services will not be able to reach this instance.shared: node: ip: host-ip # Actual IP of the host machine id: host-idSet up Supported Filestores
The filestore is where Artifactory physically stores the binaries.
Single-Node: A local filesystem is the default, but externalizing it (for example, to a dedicated volume) is recommended for easier management and potential migration.
High Availability (HA): A shared filestore is mandatory. This can be NFS, S3, Azure Blob Storage, Google Cloud Storage, or another supported object storage solution. All Artifactory nodes in the cluster must have unified and reliable network access to this single shared filestore.
For more information about configuring filestores, see Set up Filestore.
Configure HA (On Each Artifactory Node)
For HA installations, you'll ensure that the Artifactory configuration reflects its role in a cluster. A High Availability (HA) installation typically requires at least three or more nodes.
Configure
system.yamlfor HAEdit
$JFROG_HOME/artifactory/var/etc/system.yamlon each node.In the node section, set
haEnabledtotrue.taskAffinityset toanyindicates that all the nodes in the HA can act as primary nodes.
shared: node: haEnabled: true taskAffinity: anyEnsure the database section (as configured in Step 2 is also present and identical on all nodes.
Start First Artifactory Node (for Single-Node and HA)
Note
For High Availability installations, it is crucial to ensure the first Artifactory node is fully up and running, and its generated
masterKeyis copied to all other nodes before starting any subsequent Artifactory services. Failure to do so will prevent the cluster from forming correctly and lead to startup failures.Run the following command to start the Artifactory service. On the first HA node, Artifactory will initialize the database and potentially generate the
master.keyif it doesn't already exist.docker run --name artifactory_1 -v $JFROG_HOME/artifactory/var/:/var/opt/jfrog/artifactory -d -p 8081:8081 -p 8082:8082 releases-docker.jfrog.io/jfrog/artifactory-pro:<version> # Example: # docker run --name artifactory_1 -v $JFROG_HOME/artifactory/var/:/var/opt/jfrog/artifactory -d -p 8081:8081 -p 8082:8082 releases-docker.jfrog.io/jfrog/artifactory-pro:7.111.11
For Artifactory Open Source, replace
artifactory-prowithartifactory-oss.For Artifactory Community Edition for C/C++, replace
artifactory-prowithartifactory-cpp-ce.
For HA setup,
Add the License:
Once the first Artifactory node (for example,
artifactory_1) is fully up and running, add the license through its UI.Copy
master.keyto Other Nodes:Copy the
master.keyfile from$JFROG_HOME/artifactory/var/etc/security/of the first node to the identical path on all other nodes.Start Remaining Nodes for HA:
Once the
masterKeyis synchronized across all nodes, start the Artifactory service on the remaining nodes:# Start the second node: docker run --name artifactory_2 -v $JFROG_HOME/artifactory/var/:/var/opt/jfrog/artifactory -d -p 8083:8081 -p 8084:8082 releases-docker.jfrog.io/jfrog/artifactory-<pro|oss|cpp-ce>:<version> # Example: # docker run --name artifactory_2 -v $JFROG_HOME/artifactory/var/:/var/opt/jfrog/artifactory -d -p 8083:8081 -p 8084:8082 releases-docker.jfrog.io/jfrog/artifactory-pro:7.111.11 # Start the third node (if applicable): docker run --name artifactory_3 -v $JFROG_HOME/artifactory/var/:/var/opt/jfrog/artifactory -d -p 8085:8081 -p 8086:8082 releases-docker.jfrog.io/jfrog/artifactory-<pro|oss|cpp-ce>:<version> # Example: # docker run --name artifactory_3 -v $JFROG_HOME/artifactory/var/:/var/opt/jfrog/artifactory -d -p 8085:8081 -p 8086:8082 releases-docker.jfrog.io/jfrog/artifactory-pro:7.111.11
Monitor Artifactory
To manage Artifactory using native Docker commands:
List running containers:
docker ps
Stop Artifactory container (replace
artifactorywith your container name, for example,artifactory_1):docker stop artifactory
Check Artifactory logs:
docker logs -f artifactory
Access Artifactory UI
After starting Artifactory, open your browser and go to
http://<SERVER_HOSTNAME>:8082/, replacing<SERVER_HOSTNAME>with your server's actual IP address or hostname.For HA setup, you will typically access Artifactory through a load balancer that distributes traffic across your HA nodes. Configure your load balancer to direct traffic to
http://< ARTIFACTORY_NODE_IP>:8082/on each node.Initial Setup
Upon first access, you'll be guided through an onboarding wizard:
Change Default Admin Password: The default credentials are admin/password. Change this immediately.
Configure Base URL: Configure the Base URL.
Apply Licenses: If you have an Artifactory Pro or Enterprise license, apply it.