Install JFrog Artifactory on Ubuntu 20.04|18.04|16.04

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.

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.

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

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

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

sudo mkdir -p /jfrog/artifactory

sudo chown -R 1030 /jfrog/

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

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-1024x344

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

Artifactory can be accessed using the following URL:

http://SERVERIP_OR_DOMAIN:8081/artifactory

You should see Artifactory welcome page.

welcome-to-artifactory-1024x513

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-1024x470

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

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.



https://www.computingpost.com/install-jfrog-artifactory-on-ubuntu-20-0418-0416-04/?feed_id=15523&_unique_id=63522e4b79604

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
ComputingPost

ComputingPost — Linux Howtos, Tutorials, Guides, News, Tips and Tricks.