We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Learn how to – How To Install JFrog Artifactory on CentOS 7

Learn how to – How To Install JFrog Artifactory on CentOS 7.

This guide will walk you through steps used to install JFrog Artifactory on CentOS 7. JFrog Artifactory is the world’s most advanced repository manager which fully supports software created in any language or using any tool.

JFrog Artifactory is designed to integrate with the majority of continuous integration and delivery tools to deliver an end to end automated solution for tracking artifacts from development to production. A number of open source plugins are available to give you an easy way to extend the capabilities of Artifactory and integrate with other tools. Examples are JenkinsTeamCityBambooMavenBower and Gradleand much more.

For Ubuntu, use: How to Install JFrog Artifactory on Ubuntu

There are different editions of JFrog Artifactory available, check the Comparison Matrix.

There two ways of installing Artifactory on CentOS 7:

  1. Using Docker
  2. Installing from RPM packages

Method 1: Install JFrog Artifactory using Docker

For Docker installation, here are the steps to use:

Step 1: Install Docker Engine

Install Docker using our previous guide:

Ensure your user account is added to docker group:

sudo usermod -aG docker $USER
newgrp docker

Confirm successful installation of docker:

$ docker version
Client: Docker Engine - Community
 Version:           23.0.6
 API version:       1.42
 Go version:        go1.19.9
 Git commit:        ef23cbc
 Built:             Fri May  5 21:21:29 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          23.0.6
  API version:      1.42 (minimum version 1.12)
  Go version:       go1.19.9
  Git commit:       9dbdbd4
  Built:            Fri May  5 21:20:38 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Step 2: Download JFrog Artifactory Docker image

Pull the latest Docker image of JFrog Artifactory.

$ docker pull docker.bintray.io/jfrog/artifactory-oss:latest
latest: Pulling from jfrog/artifactory-oss
ae9e8620cc67: Pull complete
ce9be3d6ba6c: Pull complete
b0e450ecab8e: Pull complete
31dab46d8925: Pull complete
4a18ef7f5251: Pull complete
4f4fb700ef54: Pull complete
4d8347ace69f: Pull complete
dddafb5fd988: Pull complete
571a0b9e48b2: Pull complete
5557000c2460: Pull complete
Digest: sha256:988b2eb4eb2b7edf578cf7016e9a5dff69ba86636f579c386f8fcca7570afb7b
Status: Downloaded newer image for docker.bintray.io/jfrog/artifactory-oss:latest
docker.bintray.io/jfrog/artifactory-oss:latest

For CE edition:

docker pull docker.bintray.io/jfrog/artifactory-cpp-ce

Confirm Docker images:

$ docker images
REPOSITORY                                   TAG                 IMAGE ID            CREATED             SIZE
docker.bintray.io/jfrog/artifactory-cpp-ce   latest              24d943a892ac        43 hours ago        582MB
docker.bintray.io/jfrog/artifactory-oss      latest              58d49856785f        43 hours ago        582MB

Step 3: Create Data Directory

Create data directory on host system to ensure data used on container is persistent.

sudo mkdir -p /jfrog/artifactory
sudo chown -R 1030 /jfrog/

Step 4: Start JFrog Artifactory container

To start an Artifactory container, use the command:

docker run --name artifactory -d -p 8081:8081 -p 8082:8082 
  -v /jfrog/artifactory:/var/opt/jfrog/artifactory 
  docker.bintray.io/jfrog/artifactory-oss:latest

You can pass Java system properties to the JVM running Artifactory using EXTRA_JAVA_OPTIONS. Check more on Docker setup link. See example below.

docker run --name artifactory -d -p 8081:8081 -p 8082:8082 
   -v /jfrog/artifactory:/var/opt/jfrog/artifactory 
   -e EXTRA_JAVA_OPTIONS='-Xms512m -Xmx2g -Xss256k -XX:+UseG1GC' 
   docker.bintray.io/jfrog/artifactory-oss:latest

Use docker ps command to view container information.

Step 5: Running JFrog Artifactory container with Systemd

Systemd is the default init system for CentOS 7. We can use it to manage JFrog Artifactory container.

Create Artifactory service unit file.

sudo vi /etc/systemd/system/artifactory.service

Add:

[Unit]
Description=Setup Systemd script for Artifactory Container
After=network.target

[Service]
Restart=always
ExecStartPre=-/usr/bin/docker kill artifactory
ExecStartPre=-/usr/bin/docker rm artifactory
ExecStart=/usr/bin/docker run --name artifactory -p 8081:8081 -p 8082:8082 
  -v /jfrog/artifactory:/var/opt/jfrog/artifactory 
  docker.bintray.io/jfrog/artifactory-oss:latest
ExecStop=-/usr/bin/docker kill artifactory
ExecStop=-/usr/bin/docker rm artifactory

[Install]
WantedBy=multi-user.target

Reload systemd.

sudo systemctl daemon-reload

Then start Artifactory container with systemd.

sudo systemctl start artifactory

Enable it to start at system boot.

sudo systemctl enable artifactory

Status can be checked with:

systemctl status artifactory

Sample output:

Also check service binding with:

$ sudo ss -tunelp | egrep '8081|8082'
tcp    LISTEN     0      128       *:8081                  *:*                   users:(("docker-proxy",pid=7044,fd=4)) ino:37499 sk:ffff96fe09de3e00 <->
tcp    LISTEN     0      128       *:8082                  *:*                   users:(("docker-proxy",pid=7026,fd=4)) ino:37485 sk:ffff96fe09de5d00 <->
tcp    LISTEN     0      128    [::]:8081               [::]:*                   users:(("docker-proxy",pid=7051,fd=4)) ino:36762 sk:ffff96feb68f98c0 v6only:1 <->
tcp    LISTEN     0      128    [::]:8082               [::]:*                   users:(("docker-proxy",pid=7032,fd=4)) ino:36748 sk:ffff96feb68f9080 v6only:1 <->

Step 6: Access Artifactory Web Interface

Artifactory can be accessed using the following URL:

http://SERVERIP_OR_DOMAIN:8081/artifactory

Follow setup instructions that follows.

Select the package type(s) you want to create default repositories for.

You can skip to set later.

Click “Finish” button to complete installation.

Step 7: Configure Nginx reverse proxy (Optional)

If you want to use Nginx as Proxy with SSL, check out the guide below:

Method 2: Install JFrog Artifactory using RPM

Here are the steps you need to install JFrog Artifactory on CentOS 7 from RPM packages. Before we begin first update and reboot your system.

sudo yum -y update && sudo shutdown -r now

Step 1: Install Java

Use the commands below to install Java on CentOS:

sudo yum -y install java-11-openjdk java-11-openjdk-devel

If you have more than one Java version you can set default with the following command:

sudo sudo alternatives --config java

To show default version run:

$ java -version
openjdk version "11.0.19" 2023-04-18 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.19.0.7-1.el7_9) (build 11.0.19+7-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.19.0.7-1.el7_9) (build 11.0.19+7-LTS, mixed mode, sharing)

Step 2: Set JAVA_HOME

After installing Java, Set JAVA_HOME environment variable.

Step 3: Install and Configure Database Server

Install MariaDB repository into the system:

curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s --

Install database packages:

sudo yum -y install epel-release
sudo yum install MariaDB-server MariaDB-client MariaDB-backup -y

Start and enable mariadb database server:

sudo systemctl enable --now mariadb

Secure MariaDB database server installation:

sudo mariadb-secure-installation

Step 4: Add JFrog Artifactory RPM repository

The JFrog Artifactory packages are available on official repository. Add it by running:

curl -sL https://bintray.com/jfrog/artifactory-rpms/rpm | sudo tee /etc/yum.repos.d/bintray-jfrog-artifactory-rpms.repo
wget https://releases.jfrog.io/artifactory/artifactory-rpms/artifactory-rpms.repo
sudo mv artifactory-rpms.repo /etc/yum.repos.d/;

This repository works for both Artifactory CE and Artifactory OSS editions.

Step 5: Install JFrog Artifactory on CentOS 7

Installing JFrog Artifactory is a matter of running yum command and specifying Artifactory edition to install.

Install JFrog Artifactory OSS:

sudo yum -y install jfrog-artifactory-oss wget

Install JFrog Artifactory CE:

sudo yum install jfrog-artifactory-cpp-ce wget 

Set ARTIFACTORY_HOME.

echo "export ARTIFACTORY_HOME=/opt/jfrog/artifactory" | sudo tee -a /etc/profile
source /etc/profile
env | grep ARTIFACTORY_HOME

Files and Folders Locations:

When installed from an RPM distribution, Artifactory retains the FHS (Filesystem Hierarchy Standard) format:

File/Folder Location Ownership
Tomcat home /opt/jfrog/artifactory/tomcat artifactory  (root for sub dirs)
Artifactory startup script /etc/init.d/artifactory root
Artifactory logs /var/opt/jfrog/artifactory/logs artifactory
Artifactory home /var/opt/jfrog/artifactory artifactory 
Artifactory etc /etc/opt/jfrog/artifactory artifactory 
Artifactory env variables /etc/opt/jfrog/artifactory/default artifactory 
Artifactory binary /opt/jfrog/artifactory root 

Step 6: Configuring Artifactory to use MariaDB

Enter MySQL Shell

sudo mysql -u root

Run the template to create database of Artifactory.

source /opt/jfrog/artifactory/app/misc/db/createdb_mariadb.sql;

Start Artifactory service:

sudo systemctl start artifactory.service
sudo systemctl enable artifactory.service

Check service status:

$ systemctl status artifactory.service
â—Ź artifactory.service - Artifactory service
   Loaded: loaded (/usr/lib/systemd/system/artifactory.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2023-05-15 10:32:41 UTC; 11s ago
 Main PID: 13287 (java)
   CGroup: /system.slice/artifactory.service
           ‣ 13287 /opt/jfrog/artifactory/app/third-party/java/bin/java -Djava.util.logging.config.file=/opt/jfrog/artifactory/app/artifactory/tomcat/conf/logging.properties -Djava.util.logging.m...

May 15 10:32:37 cent7.mylab.io artifactoryManage.sh[9569]: observability started. PID: 14139
May 15 10:32:38 cent7.mylab.io su[14141]: (to artifactory) root on none
May 15 10:32:38 cent7.mylab.io artifactoryManage.sh[9569]: Starting integration...
May 15 10:32:38 cent7.mylab.io artifactoryManage.sh[9569]: integration not running. Proceed to start it up.
May 15 10:32:39 cent7.mylab.io artifactoryManage.sh[9569]: integration started. PID: 14257
May 15 10:32:39 cent7.mylab.io su[14259]: (to artifactory) root on none
May 15 10:32:39 cent7.mylab.io artifactoryManage.sh[9569]: Starting event...
May 15 10:32:39 cent7.mylab.io artifactoryManage.sh[9569]: event not running. Proceed to start it up.
May 15 10:32:40 cent7.mylab.io artifactoryManage.sh[9569]: event started. PID: 14374
May 15 10:32:41 cent7.mylab.io systemd[1]: Started Artifactory service.

Step 7: Access Artifactory Web Interface

Artifactory can be accessed using the following URL:

http://SERVERIP_OR_DOMAIN:8081/artifactory

You should see Artifactory welcome page.

Check Artifactory Documentation for more features and usage guides.

Check out Available books on Amazon:

Continuous Delivery for Java Apps: Build a CD Pipeline Step by Step Using Kubernetes, Docker, Vagrant, Jenkins, Spring, Maven and Artifactory

$9.90
 in stock

Amazon.com

as of May 15, 2023 11:29 am

Liquid Software: How to Achieve Trusted Continuous Updates in the DevOps World

$19.95
$12.99

 in stock

Amazon.com

as of May 15, 2023 11:29 am

Cart

Your Cart is Empty

Back To Shop