# Behind Firewall Installation Instructions

## Post by benc on Jan 6, 2022

Hello. Need instructions and assistance on installing NVIDIA GPU docker containers on our recently purchased AMD Threadripper. It’s behind a firewall with no internet connection. I assume Lambda stack is pre-installed on the machine, so need to transfer files/containers via USB stick… Lambdalabs website indicate that this is possible.

---

## Post by markd on Jan 29, 2022

1. Lambda stack is installed.

2. You also need to install other packages for docker:

Tutorial: [NVIDIA NGC Tutorial: Run a PyTorch Docker Container using nvidia-container-toolkit on Ubuntu](/content/blog/nvidia-ngc-tutorial-run-pytorch-docker-container-using-nvidia-container-toolkit-on-ubuntu/index.html)

```bash
   sudo apt-get install -y docker.io nvidia-container-toolkit
   sudo systemctl daemon-reload
   sudo systemctl restart docker
   ```
   - So doing the mirror repository on-site is the likely solution so it can also keep up to date.
   - To just download/copy a package:

```bash
   $ mkdir download
   $ cd download
   $ apt download docker.io nvidia-container-toolkit
   $ ls
   docker.io_20.10.7-0ubuntu5~20.04.2_amd64.deb
   nvidia-container-toolkit_1.5.1+dfsg-0lambda0.20.04.1_amd64.deb
   ```
   Then copy those or dependencies over that you need.

You can see the dependencies with:

```bash
   $ apt-cache show docker.io
   Depends: adduser, containerd (>= 1.2.6-0ubuntu1~), iptables,
   debconf (>= 0.5) | debconf-2.0, libc6 (>= 2.8), libdevmapper1.02.1 (>= 2:1.02.97),
   libseccomp2 (>= 2.1.0), libsystemd0 (>= 209~)
   $ apt-cache show nvidia-container-toolkit
   Depends: libnvidia-container-tools (>= 1.4.0)
   ```
3. For moving a docker image:

```bash
   docker pull image:tag
   docker save image:tag -o file.tar
   ```
   Then on the new machine (airgapped)

```bash
   docker load -i file.tar
   ```

Save those to a device that you can move to the airgapped location. In the airgapped you can use those on the local machine or on a local registry server.

Setting up a local docker registry server:
   [Docker Registry Documentation](https://docs.docker.com/registry/deploying/)

---

**For setting up a mirrored repository:**

```bash
$ sudo cp /etc/apt/mirror.list /etc/apt/mirror.list-bak
$ sudo vi /etc/apt/mirror.list
$ diff /etc/apt/mirror.list /etc/apt/mirror.list-bak
12d11
< set base_path /var/www/html/ubuntu
17d15
< deb http://archive.lambdalabs.com/ubuntu focal main
… a commented out all other repositories (Ubuntu)…
$ sudo mkdir -p /var/www/html/ubuntu/var
$ sudo cp /var/spool/apt-mirror/var/postmirror.sh /var/www/html/ubuntu/var
$ sudo apt-mirror
$ find /var/www/html -name ‘*.deb’ | wc -l
311
$ du -sh /var/www/html/ubuntu
5.6G /var/www/html/ubuntu
```
