Saturday, December 28, 2024
Google search engine
HomeGuest BlogsInstall JFrog Artifactory on Ubuntu 22.04|20.04|18.04

Install JFrog Artifactory on Ubuntu 22.04|20.04|18.04

.tdi_3.td-a-rec{text-align:center}.tdi_3 .td-element-style{z-index:-1}.tdi_3.td-a-rec-img{text-align:left}.tdi_3.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_3.td-a-rec-img{text-align:center}}

Today we will see how to Install JFrog Artifactory on Ubuntu 20.04|18.04|16.04. JFrog Artifactory is the world’s most advanced repository manager designed to integrate with the majority of continuous integration and delivery tools. With JFrog Artifactory, delivering an end to end automated solution with artifacts tracking from development to production becomes a reality.

Artifactory is mostly used by build tools such as Maven, Apache Ant, and Gradle to store respective artifacts in its local repository to be consumption by other applications and tools. In our recent guide, we covered the installation of JFrog Artifactory on CentOS 7.

Install JFrog Artifactory on Ubuntu

The easiest way of installing and running Artifactory on Ubuntu 20.04|18.04|16.04 is by using Docker. The process is straightforward without dependency/permission hurdles. You just install Docker, download Artifactory image and spin a container.

.tdi_2.td-a-rec{text-align:center}.tdi_2 .td-element-style{z-index:-1}.tdi_2.td-a-rec-img{text-align:left}.tdi_2.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_2.td-a-rec-img{text-align:center}}

Step 1: Install Docker Engine

Install Docker using our guide: How to install Docker CE on Ubuntu / Debian / Fedora / Arch / CentOS. For a quick start, here is the process.

Install packages to allow apt to use a repository over HTTPS:

sudo apt update
sudo apt -y install apt-transport-https ca-certificates curl software-properties-common

Add Docker’s official GPG key:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add stable repository:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Install Docker CE:

sudo apt update && sudo apt -y install docker-ce

If you would like to use Docker as a non-root user, you should now consider adding your user to the “docker” group with something like:

sudo usermod -aG docker $USER

Run the command below to see a version of docker installed.

$ docker version
Client: Docker Engine - Community
 Version:           20.10.9
 API version:       1.41
 Go version:        go1.16.8
 Git commit:        c2ea9bc
 Built:             Mon Oct  4 16:08:29 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.9
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.8
  Git commit:       79ea9d3
  Built:            Mon Oct  4 16:06:37 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.11
  GitCommit:        5b46e404f6b9f661a205e28d59c982d3634148f8
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Step 2: Download JFrog Artifactory Docker image

There are different editions of JFrog Artifactory available, check the Comparison Matrix. If you’re not sure, install the OSS (Open Source Software) version. For more features, you can consider the Pro.

Pull the latest Docker image of JFrog Artifactory.

docker pull 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

Check container status:

$ docker ps
CONTAINER ID   IMAGE                                            COMMAND                  CREATED         STATUS         PORTS                                                           NAMES
1ca55e851bd3   docker.bintray.io/jfrog/artifactory-oss:latest   "/entrypoint-artifac…"   4 seconds ago   Up 2 seconds   0.0.0.0:8081-8082->8081-8082/tcp, :::8081-8082->8081-8082/tcp   artifactory
ubuntu@lorna-ubuntu20:~$ docker ps

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-pro:latest

Step 5: Running JFrog Artifactory container with Systemd

Systemd is the default init system for Ubuntu20.04|18.04|16.04. We can use it to manage JFrog Artifactory container.

Create Artifactory service unit file.

sudo vim /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:

sudo systemctl status artifactory

Sample output:

artifactory service status docker

Also check service binding with:

$ ss -tunelp | grep 8081
 tcp    LISTEN   0        128                     *:8081                *:*       users:(("docker-proxy",pid=2820,fd=4)) ino:117162 sk:b v6only:0 <->   

Step 6: Access Artifactory Web Interface

Artifactory can be accessed using the following URL:

http://SERVERIP_OR_DOMAIN:8081/artifactory

You should see Artifactory welcome page.

welcome to artifactory

Follow setup instructions that follows.

Artifactory create repositories
Artifactory finish installation

Once you complete JFrog Artifactory on Ubuntu 18.04, you should get to Administration dashboard.

Artifactory complete installation

Step 7: Configure Nginx reverse proxy (Optional)

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

Configure JFrog Artifactory behind Nginx reverse proxy and Let’s Encrypt SSL

Conclusion

JFrog Artifactory is a Universal Repository Manager supporting all major packaging formats, build tools and CI servers. Visit the 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

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 September 4, 2023 2:07 am
Learning Continuous Integration with Jenkins: A beginner's guide to implementing Continuous Integration and Continuous Delivery using Jenkins 2, 2nd Edition

Learning Continuous Integration with Jenkins: A beginner’s guide to implementing Continuous Integration and Continuous Delivery using Jenkins 2, 2nd Edition

$46.99
 in stock
10 new from $44.92
9 used from $11.54

Free shipping

Amazon.com

as of September 4, 2023 2:07 am
Liquid Software: How to Achieve Trusted Continuous Updates in the DevOps World

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

$19.95
$12.99

 in stock

Amazon.com

as of September 4, 2023 2:07 am

Others Articles:

.tdi_4.td-a-rec{text-align:center}.tdi_4 .td-element-style{z-index:-1}.tdi_4.td-a-rec-img{text-align:left}.tdi_4.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_4.td-a-rec-img{text-align:center}}

RELATED ARTICLES

Most Popular

Recent Comments