Folks: Let's get Claude Code native installer working for FreeBSD

Hello everyone.

This is the way I do it.
It works on 15.1 and it's easy.

# Switch to the latest branch
Code:
grep -h '^[A-Za-z-]*:' /etc/pkg/FreeBSD.conf
mkdir -p /usr/local/etc/pkg/repos
cat > /usr/local/etc/pkg/repos/FreeBSD-ports.conf <<"EOF"
FreeBSD-ports: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/latest",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
EOF
pkg update -f

# Activate Linuxulator permanently
Code:
sysrc linux_enable=YES
service linux start

# Mount fdescfs with linrdlnk (without that, claude will freeze)
Code:
printf "fdesc\t/dev/fd\tfdescfs\trw,linrdlnk\t0\t0\n" >> /etc/fstab
mount -t fdescfs -o linrdlnk fdesc /dev/fd

# Install claude-code
Code:
pkg install claude-code

# Deactivate the auto-updater
Code:
cat >> ~/.profile <<'EOF'
export DISABLE_AUTOUPDATER=1
EOF

# Set your API key
Code:
export ANTHROPIC_API_KEY="sk-ant-api..."
echo 'export ANTHROPIC_API_KEY="sk-ant-api..."' >> ~/.profile

# Start Claude code
Code:
claude
 
Back
Top