# Installing IJulia for all users for JupyterHub

**URL:** <https://discourse.julialang.org/t/installing-ijulia-for-all-users-for-jupyterhub/42528>\
**Category:** General Usage\
**Tags:** jupyter, pkg\
**Created:** [July 4, 2020, 3:59pm UTC](https://discourse.julialang.org/t/installing-ijulia-for-all-users-for-jupyterhub/42528 "2020-07-04T15:59:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![camtheman256](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/camtheman256/32/16144_2.png) [@camtheman256](https://discourse.julialang.org/u/camtheman256)\
**Post date:** [July 4, 2020, 3:59pm UTC](https://discourse.julialang.org/t/installing-ijulia-for-all-users-for-jupyterhub/42528/1 "2020-07-04T15:59:50Z")

</div>

Hi, I’m trying to figure out how to setup IJulia for all users on my JupyterHub server.  
I know that Julia has “depots” in global locations, but I’m not sure how to install packages there. When I run Pkg.depots(), I see this:

```julia
julia> Pkg.depots()
3-element Array{String,1}:
 "/home/ubuntu/.julia"
 "/opt/julia-1.4.2/local/share/julia"
 "/opt/julia-1.4.2/share/julia"

```

Can someone help me out, or let me know if this is possible?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [July 4, 2020, 4:02pm UTC](https://discourse.julialang.org/t/installing-ijulia-for-all-users-for-jupyterhub/42528/2 "2020-07-04T16:02:07Z")

</div>

See this thread: [Julia kernel on JupyterHub system-wide LDAP](https://discourse.julialang.org/t/julia-kernel-on-jupyterhub-system-wide-ldap/14809)

---

<div class="post-metadata">

**Author:** ![camtheman256](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/camtheman256/32/16144_2.png) [@camtheman256](https://discourse.julialang.org/u/camtheman256)\
**Post date:** [July 4, 2020, 4:16pm UTC](https://discourse.julialang.org/t/installing-ijulia-for-all-users-for-jupyterhub/42528/3 "2020-07-04T16:16:20Z")

</div>

Ok, so I’m attempting to follow the instructions on this post ([Julia kernel on JupyterHub system-wide LDAP - #6 by barche](https://discourse.julialang.org/t/julia-kernel-on-jupyterhub-system-wide-ldap/14809/6)) and I’m running

```nohighlight
$ JULIA_DEPOT_PATH=/opt/julia-1.4.2/share/julia sudo julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.4.2 (2020-05-23)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

(@v1.4) pkg> add IJulia
   Updating registry at `~/.julia/registries/General`
   Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Resolving package versions...
   Updating `~/.julia/environments/v1.4/Project.toml`
 [no changes]
   Updating `~/.julia/environments/v1.4/Manifest.toml`
 [no changes]

```

It looks like it’s still using the local depot. How do I get it to switch to the global one?

---

<div class="post-metadata">

**Author:** ![camtheman256](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/camtheman256/32/16144_2.png) [@camtheman256](https://discourse.julialang.org/u/camtheman256)\
**Post date:** [July 4, 2020, 4:44pm UTC](https://discourse.julialang.org/t/installing-ijulia-for-all-users-for-jupyterhub/42528/4 "2020-07-04T16:44:17Z")

</div>

I’ve been trying some more stuff. With the command above, it looked like sudo was interfering with the `Base.DEPOT_PATH` variable getting set. What worked was this command:

```bash
$ sudo env JULIA_DEPOT_PATH=/opt/julia-1.4.2/share/julia julia

```

This allowed me to install IJulia to the global depot. However, after that I had to run:

```bash
$ sudo mv ~/.local/share/jupyter/kernels/julia-1.4/ /usr/share/jupyter/kernels

```

so the IJulia kernel could be used globally on the system. Now the kernel works systemwide on my JupyterHub server

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [November 26, 2020, 7:36am UTC](https://discourse.julialang.org/t/installing-ijulia-for-all-users-for-jupyterhub/42528/5 "2020-11-26T07:36:13Z")

</div>

I’ve put together a stop-by-step guide for this:  
[https://github.com/mauro3/JupyterHubWithJulia](https://github.com/mauro3/JupyterHubWithJulia)

Note though that I’m not sure this is the “best” or even a “good” solution. But it seems to work from the little testing I did so far. One issue I’m not clear about is how it will interact with updating, in particular IJulia.

See also: [https://github.com/jupyterhub/the-littlest-jupyterhub/issues/279](https://github.com/jupyterhub/the-littlest-jupyterhub/issues/279)

---

<div class="post-metadata">

**Author:** ![Guanglin\_Du](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/guanglin_du/32/43088_2.png) [@Guanglin\_Du](https://discourse.julialang.org/u/Guanglin_Du)\
**Post date:** [September 30, 2022, 3:19am UTC](https://discourse.julialang.org/t/installing-ijulia-for-all-users-for-jupyterhub/42528/6 "2022-09-30T03:19:22Z")

</div>

Thanks for your post, @camtheman256, which works for Julia 1.8.1 and Jupyterhub 2.02 hosted by an LXC container that is Ubuntu-20.04-based. A little update here.

1. I installed Julia to /opt/ for the ease of global availability.

```julia
sudo tar -xzf julia-1.8.1-linux-x86_64.tar.gz -C /opt/

```

1. vim /etc/bash.bashrc

```julia
# The global Julia settings to work with Jupyterhub
export JULIA_HOME="/opt/julia-1.8.1"
export JULIA_PKG_SERVER="https://mirrors.bfsu.edu.cn/julia"
export JULIA_DEPOT_PATH="$JULIA_HOME/share/julia"
export PATH="$JULIA_HOME/bin:$PATH"

```

**Note** : Here’s a [Julia Pkg Server list in Chinese](https://discourse.juliacn.com/t/topic/2969). If you’re not sure which one to choose, just use the official one: `https://pkg.julialang.org`.

1. Log out and log in to make the changes applied. Install **IJulia**.

```julia
(@v1.8) pkg> add IJulia

```

1. Create folders and move the Julia kernel.

```julia
sudo mkdir -p /usr/share/jupyter/kernels
sudo mv ~/.local/share/jupyter/kernels/julia-1.8/ /usr/share/jupyter/kernels/

ls /usr/share/jupyter/kernels/julia-1.8/
kernel.json logo-32x32.png logo-64x64.png

```

1. After restarting Jupyterhub or its kernel from the webpage, the Julia 1.8.1 kernel option should appear.

---

<div class="post-metadata">

**Author:** ![Guanglin\_Du](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/guanglin_du/32/43088_2.png) [@Guanglin\_Du](https://discourse.julialang.org/u/Guanglin_Du)\
**Post date:** [November 10, 2022, 11:42am UTC](https://discourse.julialang.org/t/installing-ijulia-for-all-users-for-jupyterhub/42528/8 "2022-11-10T11:42:49Z")

</div>

I haven’t run into any permission problems to install Julia and IJulia that way.

---

<div class="post-metadata">

**Author:** ![OliverTUBAF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olivertubaf/32/221395_2.png) [@OliverTUBAF](https://discourse.julialang.org/u/OliverTUBAF)\
**Post date:** [March 26, 2026, 12:32pm UTC](https://discourse.julialang.org/t/installing-ijulia-for-all-users-for-jupyterhub/42528/9 "2026-03-26T12:32:17Z")

</div>

Same here, when a user tries to install a package, e.g. Pkg.add(“CSV”) it results in

Resolving package versions…

SystemError: opening file "[/path/to/shared/julia/1.12.5/depot/environments/v1.12/Project.toml]: Permission denied
