Mirroring Magento Marketplace Packages in Private Packagist

Nils Adermann
Jan 11, 2017 · 3 min read

As of today Private Packagist supports mirroring Composer repositories which require authentication. This expands on the mirroring functionality we were already providing for Packagist.org and other open Composer repositories like Drupal’s or Wordpress’.

Mirrored packages show up in your Private Packagist search results, your License Review, and can be installed from your Private Packagist repository with Composer. Their distribution files are cached in your Private Packagist organization to make downloads redundant and faster.

To setup credentials for a repository, “Magento Marketplace” in our example, head to Settings > Manage Credentials in your Private Packagist organization. Afterwards you can add a new mirrored third party repository under Settings as well. From then on packages can be manually or automatically mirrored based on your configuration.

Head over to https://packagist.com to try Private Packagist for free!

Magento Marketplace Walkthrough

In the following section I’ll show you every step of mirroring packages from Magento Marketplace. Start by hitting “Manage Credentials” in your organizations settings. My organization is called “Magento-Demo”.

Next enter a description, I’m going with “Magento Marketplace Credentials”, and select “Magento Marketplace” as the authentication type. The domain “repo.magento.com” will be filled in automatically. Now we need the Magento Marketplace Public and Private Key, we’ll click on “My Access Keys” to get to the Magento Marketplace website.

Make sure you’re on the Magento 2 Access Keys page, and then copy and paste the Private and Public keys into the respective fields on Private Packagist. Once you’re done, hit “Create” on the Private Packagist Credentials page.

With the credentials set up we can now mirror a new Composer repository under Settings in the Private Packagist organization.

Pick a name for the repository, I picked “Magento Marketplace”, enter the URL “https://repo.magento.com” and pick the credentials we just set up for authentication with this repository. You can choose whether you would like packages to be mirrored automatically when someone tries to access them through composer update, or if you would like to add them yourself manually.

Under Packages we can now add a package “From Mirror”.

I’m going to enter just one package for the demo, but you can add as many as you like here. I’m going with “magento/module-catalog”. Make sure to select the “Magento Marketplace” Mirror repository underneath, and hit “Add”.

Private Packagist downloads the package metadata in the background and then notifies us that the package has been initialized, and it’s now accessible through composer update & composer install and shows up on package searches in Private Packagist!

Head over to https://packagist.com to try Private Packagist for free!

Private Packagist

The Composer package archive as a service for PHP: Private…

Private Packagist

The Composer package archive as a service for PHP: Private Packagist makes installing your code with Composer faster, more reliable and more convenient than any alternative.

Nils Adermann

Written by

Co-Founder of Packagist Conductors & Creator of Composer for PHP

Private Packagist

The Composer package archive as a service for PHP: Private Packagist makes installing your code with Composer faster, more reliable and more convenient than any alternative.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

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