Nexus Repository
Universal artifact repository for Maven, npm, Docker, etc.
Overview
Nexus Repository Manager is Sonatype's universal artifact repository platform that serves as a centralized hub for storing, managing, and distributing software components across multiple package formats including Maven, npm, Docker, PyPI, NuGet, and dozens of other repository types. Originally built to solve Maven dependency management challenges in Java ecosystems, Nexus has evolved into a comprehensive DevOps platform that supports the entire software supply chain with features like vulnerability scanning, policy enforcement, and component intelligence.
This Docker deployment creates a complete artifact management solution by running Nexus Repository Manager 3 with dedicated ports for different repository protocols - port 8081 for the web interface and most repository formats, port 8082 specifically configured for Docker registry operations, and port 8083 available for additional protocol configurations. The setup enables organizations to proxy external repositories like Maven Central or npmjs.org while maintaining local caches, host private artifacts securely, and create repository groups that combine multiple sources into unified endpoints.
Development teams managing multiple programming languages, DevOps engineers implementing CI/CD pipelines, and organizations requiring strict control over their software supply chain will find this configuration invaluable. The multi-port architecture allows simultaneous operation of different repository types while the persistent volume ensures artifact data survives container restarts, making it suitable for both development environments and production artifact management workflows.
Key Features
- Universal repository format support including Maven, npm, Docker, PyPI, NuGet, RubyGems, Conan, and 30+ other package types
- Repository proxying with intelligent caching to reduce external bandwidth usage and provide offline access to dependencies
- Multi-port architecture with dedicated Docker registry port (8082) and configurable protocol-specific endpoints
- Built-in vulnerability scanning and component intelligence with detailed security reports for stored artifacts
- Repository grouping functionality to combine multiple repositories into single logical endpoints for simplified client configuration
- Advanced search capabilities with component metadata indexing and dependency relationship mapping
- Role-based access control with LDAP/Active Directory integration and fine-grained repository permissions
- Cleanup policies for automated artifact lifecycle management and storage optimization
Common Use Cases
- 1Enterprise artifact management for organizations with multiple development teams using different programming languages and package managers
- 2CI/CD pipeline acceleration by providing local caching of external dependencies to reduce build times and bandwidth costs
- 3Air-gapped development environments where teams need offline access to external package repositories
- 4Docker registry hosting for private container images with integrated vulnerability scanning before deployment
- 5Software supply chain security implementation with policy enforcement and component approval workflows
- 6Multi-environment artifact promotion from development through staging to production with controlled release processes
- 7Open source license compliance management by tracking and analyzing component licenses across all artifacts
Prerequisites
- Minimum 4GB RAM allocated to Docker (Nexus Repository Manager requires 2-4GB heap space depending on repository size)
- At least 20GB available disk space for the nexus_data volume (artifact storage grows significantly over time)
- Ports 8081, 8082, and 8083 available on the host system without conflicts from other services
- Basic understanding of repository management concepts and the specific package managers your organization uses
- Administrative access to configure firewall rules if deploying in corporate networks with strict access controls
- Knowledge of your organization's LDAP/Active Directory structure if planning to integrate authentication systems
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 nexus: 3 image: sonatype/nexus3:latest4 container_name: nexus5 restart: unless-stopped6 volumes: 7 - nexus_data:/nexus-data8 ports: 9 - "8081:8081"10 - "8082:8082"11 - "8083:8083"1213volumes: 14 nexus_data: .env Template
.env
1# Get admin password:2# docker exec nexus cat /nexus-data/admin.passwordUsage Notes
- 1Docs: https://help.sonatype.com/repomanager3
- 2Access at http://localhost:8081
- 3Get password: docker exec nexus cat /nexus-data/admin.password
- 4Create repositories: Maven, npm, Docker, PyPI, NuGet, etc.
- 5Port 8082 for Docker registry, 8083 for other protocols
- 6Proxy remote repos for caching and offline access
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 nexus:5 image: sonatype/nexus3:latest6 container_name: nexus7 restart: unless-stopped8 volumes:9 - nexus_data:/nexus-data10 ports:11 - "8081:8081"12 - "8082:8082"13 - "8083:8083"1415volumes:16 nexus_data:17EOF1819# 2. Create the .env file20cat > .env << 'EOF'21# Get admin password:22# docker exec nexus cat /nexus-data/admin.password23EOF2425# 3. Start the services26docker compose up -d2728# 4. View logs29docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/nexus-repository/run | bashTroubleshooting
- Container fails to start with permission errors: Ensure the Docker daemon has sufficient privileges and the nexus_data volume has correct ownership (nexus user UID 997)
- Web interface shows 503 Service Unavailable: Nexus is still starting up - check logs with 'docker logs nexus' and wait 2-5 minutes for complete initialization
- Docker registry push fails with authentication errors: Verify Docker registry connector is properly configured on port 8082 and Docker client is authenticated to the correct endpoint
- Out of memory errors during artifact upload: Increase Docker memory allocation or configure Nexus JVM heap size using NEXUS_JAVA_OPTS environment variable
- Repository synchronization fails with proxy repositories: Check network connectivity to upstream repositories and verify any corporate proxy settings are configured in Nexus HTTP proxy settings
- Admin password retrieval command fails: Wait for initial setup completion and ensure the admin.password file exists by checking 'docker exec nexus ls -la /nexus-data/'
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
Shortcuts: C CopyF FavoriteD Download