---
tags:
  - freebsd
  - homelab
---

# Manage jail manually

1. Enable at startup `/etc/rc.conf` line `jail_enable="YES"`
2. Add jail to `/etc/jail.conf
3. Create subvolume with `zfs create zpool/jails/<jailname>`
4. Download FreeBSD base tarball `root@pineapple:/data/jails/gitea-runner-freebsd13 # fetch https://download.freebsd.org/ftp/releases/amd64/amd64/14.1-RELEASE/base.txz -o ../14.1-base.txz`
5. `tar -xf ../dl/base-14.1-RELEASE.txz`
# Install packages in jail from host

```
pkg --jail <jailname> <packages>
```

## Handy commands

* `jls`: List jails
* `jexec <jailname | jailid>`: Login to jail

See also https://docs.freebsd.org/en/books/handbook/jails/