# How can I build a racket package "offline"?

**URL:** https://racket.discourse.group/t/how-can-i-build-a-racket-package-offline/4230
**Category:** Questions & Answers
**Created:** [May 22, 2026, 7:58pm UTC](https://racket.discourse.group/t/how-can-i-build-a-racket-package-offline/4230 "2026-05-22T19:58:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![panaeon](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/panaeon/32/339_2.png) [@panaeon](https://racket.discourse.group/u/panaeon)
#### Post date: [May 22, 2026, 7:58pm UTC](https://racket.discourse.group/t/how-can-i-build-a-racket-package-offline/4230/1 "2026-05-22T19:58:12Z")

</div>

Hi, I'm trying to build a [rash](https://github.com/willghatch/racket-rash) with nix.  
Obviously standard `raco pkg install` fails with http errors (this is intentional by nix).

Then I tried to link and call setup, but it failed....

Is there any standard way to achieve offline build?  
I'm total newbie with `raco`, any help is appreciated!

---

<div class="post-metadata">

### Author: ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)
#### Post date: [May 25, 2026, 8:13am UTC](https://racket.discourse.group/t/how-can-i-build-a-racket-package-offline/4230/2 "2026-05-25T08:13:27Z")

</div>

> [@panaeon](#):
>
> Obviously standard `raco pkg install` fails with http errors (this is intentional by nix).

> Obviously standard `raco pkg install` fails with http errors (this is intentional by nix).

You need to change the settings of the nix sandbox.

Or install Racket with the normal installer:

> **[Download Racket](https://download.racket-lang.org/)**

---

<div class="post-metadata">

### Author: ![usao](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/usao/32/1375_2.png) [@usao](https://racket.discourse.group/u/usao)
#### Post date: [May 26, 2026, 3:58am UTC](https://racket.discourse.group/t/how-can-i-build-a-racket-package-offline/4230/3 "2026-05-26T03:58:03Z")

</div>

I’m not sure if [giving `--type dir` or something to `raco pkg install`](https://docs.racket-lang.org/pkg/cmdline.html#%28part._raco-pkg-install%29) would work in your case, but you could try.

---

<div class="post-metadata">

### Author: ![LiberalArtist](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/liberalartist/32/151_2.png) [@LiberalArtist](https://racket.discourse.group/u/LiberalArtist)
#### Post date: [May 26, 2026, 7:30pm UTC](https://racket.discourse.group/t/how-can-i-build-a-racket-package-offline/4230/4 "2026-05-26T19:30:16Z")

</div>

Racket builds work perfectly well offline: the only reason `raco pkg install` will try to access the network is to download and install transitive dependencies.\[1\]

There are `raco pkg` subcommands that can be used for downloading package sources, but, if you are using Nix, you probably want to write Nix expressions to obtain all of the relevant sources.

Once you have the sources, you will want to use something like [`racket -l- pkg/dirs-catalog --immediate ./local-catalog /nix/store/x/dependency-src ...+`](https://docs.racket-lang.org/pkg/dirs-catalog.html) to make a local catalog that `raco pkg install --catalog ./local-catalog` can use to resolve dependencies.

If you have any further trouble, feel free to share your Nix code and specific error messages you encounter.

* * *

1. Strictly speaking, a package _could_ try to use the network during building, but, for example, [the package-build service](https://pkg-build.racket-lang.org/about.html) runs builds in a sandbox with no network, so any package with a succeeding build at [https://pkgs.racket-lang.org](https://pkgs.racket-lang.org) will work.
