Create a free private npm registry with Bytesafe
Tags: npm, javascript, devops, webdev
Published: 2020-05-08 13:29:22

![Bytesafe](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0zk2lu2usahg06ynhjy7.png)


## Why use a private registry?

Regardless if you are looking for a place to host all your own packages and public packages in one place, reduce business risks, continuously want to monitor packages for vulnerabilities or license issues or require a dependency firewall - using a private registry is the right way to go.

There are different alternatives out there. The benefit of using a hosted service is that you can focus on your code and can get started without having to think of and plan for infrastructure, capacity management, maintenance and such things.

This post describes how you can set up a free private npm registry using [Bytesafe](https://bytesafe.dev) in no time.

For me it’s important that the developer experience is great when using a new service. That translates into that the service needs to be well documented, that there is great support if I need it and most importantly that the service needs to be easy to understand and fast to get started. That is why we’ve developed Bytesafe. Btw, I am one of the founders.


## How to set up a private registry with minimal effort?

Great! You’ve decided you need a private registry and want to get going. Follow these steps to get your own private registry using Bytesafe

1. **Create workspace**. First create your own workspace by [signing up](https://login.bytesafe.dev/signup). Just select the workspace name that you would like to use. When you have created your account you can access your workspace by using the workspace name you’ve just create: https://<_workspace_>.bytesafe.dev

2. **Sign in**. Use your GitHub or Google login or sign in using email and password. Congratulations! You now have access to your first private registry called "default". It's ready to be used. Adding more registries is quick and easy!

3. **Configure the npm client**. Use the client you are used to (npm, yarn, pnpm) with your new private registry using [login credentials](https://docs.bytesafe.dev/authentication/) from Bytesafe.

```javascript

/* 1. Login to your registry. Credentials are stored in your local .npmrc file*/

$ npm --registry 'https://example.bytesafe.dev/r/default/' login

/* 2. Install your npm packages. Just point out the registry you want to use and install as you normally do*/

$ npm --registry 'https://example.bytesafe.dev/r/default/' install <package>

```

**Don’t see your packages in the registry?** You might need to force requests to [bypass your local npm cache](https://docs.bytesafe.dev/troubleshooting/missing-packages).


## That's it!

Hope you'll enjoy your private registries. You have just added a layer of security with your first hosted private registry where packages are continuously scanned for vulnerabilities and license issues. Any issues will be seen in the Bytesafe Dashboard.

If you'd like to watch a video on how to work with secure private registries, then check out this post as well:

{% link https://dev.to/danielp/how-to-use-secure-private-npm-registries-36m9 %}


From here you can create more registries, enable [plugins](https://docs.bytesafe.dev/plugins/) and [policies](https://docs.bytesafe.dev/policies/) to get the right level of control that you require and optionally you can invite new team members which is a premium feature (as you'll have free trial of the Teams plan).

If you’re interested in reading more about best practices, please visit the [npm security best practices](https://bytesafe.dev/posts/npm-security-best-practices/) blog post with a downloadable cheat sheet, our [blog](https://bytesafe.dev/posts/) or the [docs](https://docs.bytesafe.dev/).

Have any questions or suggestions on features that you would like to see? Comment below or contact us on Twitter [@bytesafedev](https://twitter.com/bytesafedev).

![Know your dependencies with Bytesafe](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vkqdq0dkp354hhx3rwln.png)

## Want to know more about npm security best practices?
Creating your own Bytesafe workspace is the first step in improving on security. Here are the top 10 npm security best practices you should consider:

{% link https://dev.to/danielp/top-10-npm-security-best-practices-2lp9 %}


[![Follow Bytesafe on Twitter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3uehdo8j7i2g40bk382.png)](https://twitter.com/bytesafedev) <a href="https://www.producthunt.com/posts/bytesafe?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-bytesafe" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=300547&theme=light" alt="Bytesafe - A better way to control your software supply chain | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>