-
Notifications
You must be signed in to change notification settings - Fork 461
Installation Guide
Complete installation instructions for all platforms
- Prerequisites
- Installation Methods
- Platform-Specific Instructions
- Verification
- Configuration File Locations
- Troubleshooting
- Next Steps
- Python: 3.7 or later (3.9+ recommended)
- OS: Linux, macOS, *BSD, Windows
- Memory: Minimum 512MB RAM (1GB+ for production)
- Disk: 50MB for installation
- Network: BGP peer must be reachable
ExaBGP has minimal dependencies - pure Python implementation with no required external libraries.
The simplest and recommended method for most users.
pip3 install exabgppip3 install exabgp==4.2.25pip3 install --upgrade exabgppip3 install --user exabgpThe binary will be in ~/.local/bin/exabgp - ensure this is in your PATH:
export PATH=$PATH:~/.local/binFor development, testing, or running the latest unreleased features.
git clone https://github.com/Exa-Networks/exabgp.git
cd exabgppip3 install -e .This creates a symbolic link, so code changes take effect immediately without reinstalling.
git clone https://github.com/Exa-Networks/exabgp.git
cd exabgp
git checkout 5.0 # Or any branch/tag
pip3 install -e .git clone https://github.com/Exa-Networks/exabgp.git
cd exabgp
./sbin/exabgp --helpSet environment variable for this method:
export PYTHONPATH=/path/to/exabgp/libOfficial Debian/Ubuntu packages:
sudo apt-get update
sudo apt-get install exabgpNote: Distribution packages may be outdated. Use pip for latest version.
Check version:
apt-cache policy exabgpEPEL repository (may be available):
sudo yum install epel-release
sudo yum install exabgpOr use pip:
sudo yum install python3-pip
sudo pip3 install exabgpAUR package:
yay -S exabgp
# or
paru -S exabgpPorts:
cd /usr/ports/net/exabgp
make install cleanPackages:
pkg install py39-exabgpNote: No official Homebrew formula exists. Use pip:
brew install python3
pip3 install exabgpOfficial Docker images for containerized deployments.
docker pull exa networks/exabgp:latestSpecific version:
docker pull exanetworks/exabgp:4.2.25docker run -it --rm \
-v /path/to/exabgp.conf:/etc/exabgp/exabgp.conf:ro \
-v /path/to/api-scripts:/etc/exabgp/api:ro \
--network host \
exanetworks/exabgp:latest \
exabgp /etc/exabgp/exabgp.confExplanation:
-
-v /path/to/exabgp.conf:/etc/exabgp/exabgp.conf:ro- Mount config (read-only) -
-v /path/to/api-scripts:/etc/exabgp/api:ro- Mount API scripts -
--network host- Use host networking for BGP (TCP 179)
Create docker-compose.yml:
version: '3'
services:
exabgp:
image: exanetworks/exabgp:latest
container_name: exabgp
network_mode: host
volumes:
- ./exabgp.conf:/etc/exabgp/exabgp.conf:ro
- ./api:/etc/exabgp/api:ro
command: exabgp /etc/exabgp/exabgp.conf
restart: unless-stoppedRun:
docker-compose up -dsudo pip3 install exabgpsudo useradd -r -s /bin/false -c "ExaBGP" exabgpCreate /etc/systemd/system/exabgp.service:
[Unit]
Description=ExaBGP BGP Speaker
After=network.target
[Service]
Type=simple
User=exabgp
Group=exabgp
ExecStart=/usr/local/bin/exabgp /etc/exabgp/exabgp.conf
ExecReload=/bin/kill -USR1 $MAINPID
Restart=on-failure
RestartSec=5
# Security hardening
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/run/exabgp
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl daemon-reload
sudo systemctl enable exabgp
sudo systemctl start exabgp
sudo systemctl status exabgpbrew install python3pip3 install exabgpCreate ~/Library/LaunchAgents/com.exabgp.daemon.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.exabgp.daemon</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/exabgp</string>
<string>/usr/local/etc/exabgp/exabgp.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/exabgp.log</string>
<key>StandardOutPath</key>
<string>/usr/local/var/log/exabgp.log</string>
</dict>
</plist>Load service:
launchctl load ~/Library/LaunchAgents/com.exabgp.daemon.plist# Using ports
cd /usr/ports/net/exabgp
make install clean
# Or packages
pkg install py39-exabgppkg_add py3-pip
pip3 install exabgpCreate /etc/rc.d/exabgp:
#!/bin/sh
#
# PROVIDE: exabgp
# REQUIRE: NETWORKING
# KEYWORD: shutdown
. /etc/rc.subr
name="exabgp"
rcvar=exabgp_enable
command="/usr/local/bin/exabgp"
command_args="/usr/local/etc/exabgp/exabgp.conf"
pidfile="/var/run/${name}.pid"
load_rc_config $name
run_rc_command "$1"Enable in /etc/rc.conf:
exabgp_enable="YES"
Download and install Python from https://www.python.org/downloads/
Important: Check "Add Python to PATH" during installation.
pip install exabgpexabgp C:\exabgp\exabgp.confUse NSSM (Non-Sucking Service Manager) to run ExaBGP as a service:
- Download NSSM: https://nssm.cc/download
- Install service:
nssm install ExaBGP "C:\Python39\Scripts\exabgp.exe" "C:\exabgp\exabgp.conf"
nssm start ExaBGPexabgp --versionExpected output:
ExaBGP 4.2.25
which exabgp
# Linux/macOS: /usr/local/bin/exabgp or ~/.local/bin/exabgp
pip3 show exabgp
# Shows installation location and versionexabgp --test /etc/exabgp/exabgp.confExpected output if valid:
OK
env exabgp.log.level=DEBUG exabgp /etc/exabgp/exabgp.confYou should see detailed log output showing ExaBGP starting up.
Linux:
-
/etc/exabgp/exabgp.conf- Main configuration -
/etc/exabgp/api/- API scripts -
/var/log/exabgp.log- Log file
macOS:
/usr/local/etc/exabgp/exabgp.conf/usr/local/var/log/exabgp.log
FreeBSD:
/usr/local/etc/exabgp/exabgp.conf/var/log/exabgp.log
# Linux
sudo mkdir -p /etc/exabgp/api
sudo mkdir -p /var/log/exabgp
sudo chown -R exabgp:exabgp /etc/exabgp /var/log/exabgp
# macOS
sudo mkdir -p /usr/local/etc/exabgp/api
sudo mkdir -p /usr/local/var/logError:
-bash: python3: command not found
Solution:
# Debian/Ubuntu
sudo apt-get install python3 python3-pip
# Red Hat/CentOS
sudo yum install python3 python3-pip
# macOS
brew install python3Error:
-bash: pip3: command not found
Solution:
# Debian/Ubuntu
sudo apt-get install python3-pip
# Red Hat/CentOS
sudo yum install python3-pip
# Using Python
python3 -m ensurepip --upgradeError:
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied
Solution 1: Install for current user only
pip3 install --user exabgpSolution 2: Use sudo (not recommended for production)
sudo pip3 install exabgpError:
-bash: exabgp: command not found
Solution:
Find where pip installed exabgp:
pip3 show -f exabgp | grep LocationAdd to PATH:
# For --user installation
export PATH=$PATH:~/.local/bin
# Make permanent
echo 'export PATH=$PATH:~/.local/bin' >> ~/.bashrc
source ~/.bashrcCheck version:
exabgp --versionUpgrade:
pip3 install --upgrade exabgpForce reinstall:
pip3 install --force-reinstall exabgpError:
ImportError: No module named 'exabgp'
Solution:
Check Python version:
python3 --version # Must be 3.7+Reinstall:
pip3 uninstall exabgp
pip3 install exabgpVerify installation:
python3 -c "import exabgp; print(exabgp.__version__)"Error:
Permission denied: Could not bind to port 179
Explanation: Port 179 requires root/administrator privileges.
Solution 1: Run ExaBGP as root (not recommended)
sudo exabgp /etc/exabgp/exabgp.confSolution 2: Use systemd/service manager (recommended)
The systemd service runs as exabgp user but has capability to bind to port 179.
Solution 3: Use port > 1024
Configure your BGP peer to connect to ExaBGP on a high port instead of 179. Not all routers support this.
Solution 4: Grant capability (Linux)
sudo setcap 'cap_net_bind_service=+ep' $(which exabgp)This allows exabgp binary to bind to privileged ports without running as root.
pip3 uninstall exabgpcd /path/to/exabgp
pip3 uninstall exabgp# Debian/Ubuntu
sudo apt-get remove exabgp
# FreeBSD
pkg delete exabgpsudo rm -rf /etc/exabgp
sudo rm -rf /var/log/exabgpNow that ExaBGP is installed, continue to:
- Quick Start - Get running in 5 minutes
- First BGP Session - Detailed BGP fundamentals
- Configuration Syntax - Complete configuration reference
- API Overview - Learn the API
- GitHub: https://github.com/Exa-Networks/exabgp
- PyPI: https://pypi.org/project/exabgp/
- Docker Hub: https://hub.docker.com/r/exanetworks/exabgp
- Documentation: Home
Installation complete? Continue to Quick Start Guide →
👻 Ghost written by Claude (Anthropic AI)
Getting Started
Configuration
- Configuration Syntax
- Neighbor Configuration
- Directives A-Z
- Templates
- Environment Variables
- Process Configuration
API
- API Overview
- Text API Reference
- JSON API Reference
- API Commands
- Writing API Programs
- Error Handling
- Production Best Practices
Address Families
- Overview
- IPv4 Unicast
- IPv6 Unicast
- FlowSpec
- EVPN
- L3VPN
- BGP-LS
- VPLS
- SRv6 / MUP
- Multicast
- RT Constraint
Features
Use Cases
Tools
Operations
Reference
- Architecture
- Design
- Attribute Reference
- Command Reference
- BGP State Machine
- Capabilities
- Communities
- Examples Index
- Glossary
- RFC Support
Integration
Migration
Community
External