# How to add registry with LocalRegistry

**URL:** <https://discourse.julialang.org/t/how-to-add-registry-with-localregistry/96379>\
**Category:** General Usage\
**Tags:** question, package-manager\
**Created:** [March 21, 2023, 9:08am UTC](https://discourse.julialang.org/t/how-to-add-registry-with-localregistry/96379 "2023-03-21T09:08:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [March 21, 2023, 9:08am UTC](https://discourse.julialang.org/t/how-to-add-registry-with-localregistry/96379/1 "2023-03-21T09:08:38Z")

</div>

Hi all,

I am trying to setup a local registry for packages that are on a private server with git. I have completed the following steps:

1. I installed LocalRegistry
2. I created a local registry with `create_registry`, which created a folder in `.julia/registries/my_local_registry`
3. I pushed the the changes in `.julia/registries/my_local_registry` to a dedicated repo on the private server

The registry contains a single file called `Registry.toml`, which contains fields for name, uuid, repo description and a blank block [packages].

The README instructs users to add the local registry with

```julia
using Pkg
pkg"registry add <repository url>"

```

However, I receive the following error:

```julia
     Cloning git-repo `https://xxxx`
    Updating git-repo `https://xxxx`
ERROR: could not find project file (Project.toml or JuliaProject.toml) in package at `https:/xxxx` maybe `subdir` needs to be specified

```

I redacted the URL. Why did it create Registry.toml but looks for Project.toml?

Thank you in advance for your help.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [March 21, 2023, 9:32am UTC](https://discourse.julialang.org/t/how-to-add-registry-with-localregistry/96379/2 "2023-03-21T09:32:30Z")

</div>

Are you certain that you’re doing `registry add <url>`? From the error it sounds like you’re doing `add <url>`, i.e. trying to add it as a package instead of a registry.

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [March 21, 2023, 9:38am UTC](https://discourse.julialang.org/t/how-to-add-registry-with-localregistry/96379/3 "2023-03-21T09:38:19Z")

</div>

Thanks for your reply (and for creating this package).

I ran the following:

```julia
pkg"add registry https://xxxx"

```

where xxxx is the url to the repo containing the registry.

Interestingly, I was able to register packages, which automatically updated the remote registry repo.

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [March 21, 2023, 9:58am UTC](https://discourse.julialang.org/t/how-to-add-registry-with-localregistry/96379/4 "2023-03-21T09:58:55Z")

</div>

I tried running `pkg"add registry https://xxxx"` on a different computer and it worked. I was able to create a new project and add the packages to the environment. Is it possible that the problem is that I ran the command on the computer I used to create the registry?

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [March 21, 2023, 10:03am UTC](https://discourse.julialang.org/t/how-to-add-registry-with-localregistry/96379/5 "2023-03-21T10:03:10Z")

</div>

The registry is already installed on the machine where you have run `create_registry` but as far as I know it should be fine to add it again.

Notice that there is a big difference between

```julia
pkg"registry add <repository url>"

```

and

```julia
pkg"add registry https://xxxx"

```

but maybe the latter is a posting typo.

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [March 21, 2023, 10:06am UTC](https://discourse.julialang.org/t/how-to-add-registry-with-localregistry/96379/6 "2023-03-21T10:06:43Z")

</div>

Thanks. That appeared to be the issue. I used “xxxx” because I did not want to paste the URL.

Everything is working very nicely. My only complaint is that I did not use this sooner 😆
