docker.recipes

JFrog Artifactory OSS + PostgreSQL

intermediate

Open source artifact repository manager.

Overview

JFrog Artifactory OSS is an open-source universal artifact repository manager that serves as a central hub for storing, organizing, and distributing binary artifacts throughout the software development lifecycle. Originally launched by JFrog in 2008, Artifactory has become the industry standard for artifact management, supporting over 30 package types including Maven, Gradle, npm, Docker, NuGet, and PyPI. The OSS version provides essential repository management capabilities for teams looking to centralize their binary artifact storage without the advanced features of the Pro and Enterprise versions. This stack combines Artifactory OSS with PostgreSQL as a robust, ACID-compliant database backend and NGINX as a high-performance reverse proxy. PostgreSQL replaces the default Derby database to provide better performance, scalability, and data integrity for production environments, while NGINX handles SSL termination, load balancing, and serves as a buffer against connection spikes. This architecture creates a production-ready artifact management platform that can handle substantial traffic loads and provides the reliability needed for continuous integration and deployment pipelines. This configuration is ideal for development teams, DevOps engineers, and organizations that need centralized artifact management with enterprise-grade database reliability but don't require the advanced features of commercial Artifactory versions. The combination delivers the performance benefits of PostgreSQL's advanced indexing and query optimization alongside NGINX's event-driven architecture, making it suitable for teams managing hundreds of artifacts daily across multiple repositories and package formats.

Key Features

  • Universal repository support for 30+ package types including Maven, Gradle, npm, Docker, NuGet, and PyPI with native metadata handling
  • PostgreSQL backend providing ACID compliance, advanced indexing, and superior query performance compared to default Derby database
  • NGINX reverse proxy with HTTP/2 support, SSL termination, and connection pooling for improved client performance
  • Virtual and remote repository aggregation allowing unified access to multiple artifact sources through single endpoints
  • Advanced artifact search capabilities with property-based filtering, checksum verification, and metadata querying
  • REST API for automated artifact deployment, retrieval, and repository management with comprehensive CLI tools
  • Built-in security scanning for open-source vulnerabilities in uploaded artifacts with detailed reporting
  • Flexible permission system with repository-level access control and user group management

Common Use Cases

  • 1Centralizing Maven and Gradle artifacts for Java development teams with automated dependency resolution
  • 2Managing Docker images for containerized applications with registry federation and vulnerability scanning
  • 3Hosting private npm packages alongside public registry proxying for Node.js development workflows
  • 4Storing release binaries and deployment artifacts for CI/CD pipelines with automated retention policies
  • 5Creating development team artifact sharing hub with role-based access control and audit trails
  • 6Implementing artifact promotion workflows between development, staging, and production repositories
  • 7Building on-premises artifact caching proxy to reduce external dependency download times and bandwidth

Prerequisites

  • Minimum 4GB RAM and 2 CPU cores recommended for production workloads handling moderate artifact traffic
  • 20GB+ free disk space for artifact storage, with additional space planning based on binary retention requirements
  • Ports 80, 443, 8081, and 8082 available for NGINX proxy and Artifactory service binding
  • Basic understanding of repository management concepts including virtual, local, and remote repository types
  • Familiarity with NGINX configuration for SSL certificate installation and custom domain setup
  • PostgreSQL administration knowledge for backup configuration and performance tuning

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 artifactory:
3 image: releases-docker.jfrog.io/jfrog/artifactory-oss:latest
4 environment:
5 - JF_SHARED_DATABASE_TYPE=postgresql
6 - JF_SHARED_DATABASE_DRIVER=org.postgresql.Driver
7 - JF_SHARED_DATABASE_URL=jdbc:postgresql://postgres:5432/artifactory
8 - JF_SHARED_DATABASE_USERNAME=${POSTGRES_USER}
9 - JF_SHARED_DATABASE_PASSWORD=${POSTGRES_PASSWORD}
10 volumes:
11 - artifactory-data:/var/opt/jfrog/artifactory
12 ports:
13 - "8082:8082"
14 - "8081:8081"
15 depends_on:
16 - postgres
17 networks:
18 - artifactory-network
19 restart: unless-stopped
20
21 postgres:
22 image: postgres:15
23 environment:
24 - POSTGRES_USER=${POSTGRES_USER}
25 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
26 - POSTGRES_DB=artifactory
27 volumes:
28 - postgres-data:/var/lib/postgresql/data
29 networks:
30 - artifactory-network
31 restart: unless-stopped
32
33 nginx:
34 image: nginx:alpine
35 volumes:
36 - ./nginx.conf:/etc/nginx/nginx.conf:ro
37 ports:
38 - "80:80"
39 - "443:443"
40 depends_on:
41 - artifactory
42 networks:
43 - artifactory-network
44 restart: unless-stopped
45
46volumes:
47 artifactory-data:
48 postgres-data:
49
50networks:
51 artifactory-network:
52 driver: bridge

.env Template

.env
1# Artifactory
2POSTGRES_USER=artifactory
3POSTGRES_PASSWORD=secure_postgres_password
4
5# Default admin: admin / password

Usage Notes

  1. 1Web UI at http://localhost:8082
  2. 2Default login: admin / password
  3. 3Configure repositories after login
  4. 4Supports Maven, Gradle, npm, Docker
  5. 5OSS version limited to certain types

Individual Services(3 services)

Copy individual services to mix and match with your existing compose files.

artifactory
artifactory:
  image: releases-docker.jfrog.io/jfrog/artifactory-oss:latest
  environment:
    - JF_SHARED_DATABASE_TYPE=postgresql
    - JF_SHARED_DATABASE_DRIVER=org.postgresql.Driver
    - JF_SHARED_DATABASE_URL=jdbc:postgresql://postgres:5432/artifactory
    - JF_SHARED_DATABASE_USERNAME=${POSTGRES_USER}
    - JF_SHARED_DATABASE_PASSWORD=${POSTGRES_PASSWORD}
  volumes:
    - artifactory-data:/var/opt/jfrog/artifactory
  ports:
    - "8082:8082"
    - "8081:8081"
  depends_on:
    - postgres
  networks:
    - artifactory-network
  restart: unless-stopped
postgres
postgres:
  image: postgres:15
  environment:
    - POSTGRES_USER=${POSTGRES_USER}
    - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    - POSTGRES_DB=artifactory
  volumes:
    - postgres-data:/var/lib/postgresql/data
  networks:
    - artifactory-network
  restart: unless-stopped
nginx
nginx:
  image: nginx:alpine
  volumes:
    - ./nginx.conf:/etc/nginx/nginx.conf:ro
  ports:
    - "80:80"
    - "443:443"
  depends_on:
    - artifactory
  networks:
    - artifactory-network
  restart: unless-stopped

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 artifactory:
5 image: releases-docker.jfrog.io/jfrog/artifactory-oss:latest
6 environment:
7 - JF_SHARED_DATABASE_TYPE=postgresql
8 - JF_SHARED_DATABASE_DRIVER=org.postgresql.Driver
9 - JF_SHARED_DATABASE_URL=jdbc:postgresql://postgres:5432/artifactory
10 - JF_SHARED_DATABASE_USERNAME=${POSTGRES_USER}
11 - JF_SHARED_DATABASE_PASSWORD=${POSTGRES_PASSWORD}
12 volumes:
13 - artifactory-data:/var/opt/jfrog/artifactory
14 ports:
15 - "8082:8082"
16 - "8081:8081"
17 depends_on:
18 - postgres
19 networks:
20 - artifactory-network
21 restart: unless-stopped
22
23 postgres:
24 image: postgres:15
25 environment:
26 - POSTGRES_USER=${POSTGRES_USER}
27 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
28 - POSTGRES_DB=artifactory
29 volumes:
30 - postgres-data:/var/lib/postgresql/data
31 networks:
32 - artifactory-network
33 restart: unless-stopped
34
35 nginx:
36 image: nginx:alpine
37 volumes:
38 - ./nginx.conf:/etc/nginx/nginx.conf:ro
39 ports:
40 - "80:80"
41 - "443:443"
42 depends_on:
43 - artifactory
44 networks:
45 - artifactory-network
46 restart: unless-stopped
47
48volumes:
49 artifactory-data:
50 postgres-data:
51
52networks:
53 artifactory-network:
54 driver: bridge
55EOF
56
57# 2. Create the .env file
58cat > .env << 'EOF'
59# Artifactory
60POSTGRES_USER=artifactory
61POSTGRES_PASSWORD=secure_postgres_password
62
63# Default admin: admin / password
64EOF
65
66# 3. Start the services
67docker compose up -d
68
69# 4. View logs
70docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/artifactory-oss/run | bash

Troubleshooting

  • Artifactory fails to start with database connection errors: Verify POSTGRES_USER and POSTGRES_PASSWORD environment variables match between services and ensure PostgreSQL is fully initialized before Artifactory startup
  • Web UI shows 502 Bad Gateway errors: Check that Artifactory service is running on port 8082 and NGINX upstream configuration correctly points to artifactory:8082 internal address
  • PostgreSQL container exits with permission denied errors: Ensure postgres-data volume has correct ownership (999:999) or initialize with proper user mapping using init containers
  • Artifact uploads fail with insufficient storage errors: Monitor artifactory-data volume usage and implement cleanup policies for old artifacts or increase allocated storage
  • Repository resolution extremely slow: Tune PostgreSQL memory settings in postgresql.conf, increase shared_buffers and work_mem based on available system RAM
  • Docker registry push/pull operations timeout: Increase NGINX client_max_body_size directive and proxy timeout values to accommodate large container image transfers

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space