fabric2
High level SSH command execution
What it is and what it does
Fabric is a Python library for executing shell commands on remote systems over SSH. It wraps Invoke (for local subprocess and CLI features) and Paramiko (for SSH protocol) into a unified API that lets you write Python code to automate system administration, deployment, and orchestration tasks across multiple servers.
You define tasks in Python, connect to remote hosts via SSH, run commands, and capture their output as Python objects. This makes it natural to script complex multi-host operations, error handling, and conditional logic in Python rather than shell scripts. The library is actively maintained, has no known vulnerabilities, and supports modern Python versions across Linux, macOS, and Windows.
Use it for:
- Deploy applications to production servers by running remote build, test, and install commands over SSH.
- Automate system administration tasks like user provisioning, log rotation, or service restarts across a fleet of servers.
- Orchestrate multi-step workflows that require conditional logic and error handling across multiple remote hosts.
- Run ad-hoc commands on remote systems and capture output for monitoring, auditing, or reporting.
- Build custom deployment pipelines that integrate with your Python codebase and CI/CD workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Fabric executes shell commands remotely over SSH and returns Python objects, building on Invoke and Paramiko to provide a high-level interface for remote command execution and system administration tasks.
Yes. Fabric is a mature, actively maintained library with no known vulnerabilities, low install friction, and a permissive license. It is the standard choice for Python-based SSH automation and remote command execution. Install it if you need to automate tasks across remote systems from Python code.
Install
fabric2 on PyPI
pip
pip install fabric2uv
uv add fabric2poetry
poetry add fabric2Installing fabric2
Before you install
Low install friction with a pure-Python wheel distribution. The package is actively maintained with a recent commit history and carries four straightforward runtime dependencies (invoke, paramiko, decorator, deprecated), all of which are well-established libraries.
License in practice
Licensed under BSD (permissive), so you can use Fabric in commercial and proprietary projects without restriction, though you must include the license notice in distributions.
Quickstart
pip install fabric2
from fabric import Connection
conn = Connection('user@example.com')
result = conn.run('ls -la')
print(result.stdout)
Requires SSH access to a remote host; the remote system must have a shell available for command execution.
Verify before relying
- Whether Python 2.7 support mentioned in the description excerpt is still active in version 3.2.3 or has been dropped.
- Specific performance characteristics or limits for concurrent remote command execution.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — invoke, paramiko, decorator, deprecated |
| Maintenance | actively maintained — 130 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 98,314/month — #13,094 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fabric2-3.2.3-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
fabricFabric executes shell commands remotely over…
permissive · top 5,000 on PyPI
paramikoParamiko is a pure-Python SSH protocol library…
copyleft · top 1,000 on PyPI
invokeInvoke is a Python library for defining and…
permissive · top 1,000 on PyPI
Fabric3Fabric3 is a Python 2.7 and 3.4+ compatible…
permissive · top 15,000 on PyPI
patchworkPatchwork provides idempotent Unix system…
permissive · top 15,000 on PyPI
awsCommand-line tool to manage Amazon EC2 and ELB…
permissive · top 15,000 on PyPI
jumpsshJumpSSH runs commands on remote servers through…
permissive · top 15,000 on PyPI
spurProvides a unified Python interface to run…
permissive · top 15,000 on PyPI
proxmoxerProxmoxer is a Python wrapper for the Proxmox…
permissive · top 15,000 on PyPI
python-hpiloAutomates HP iLO (Integrated Lights Out) server…
unclear · top 15,000 on PyPI