API Reference

Fabric

A high-level Python library for executing shell commands over SSH to automate remote deployments.

Official Documentation ↗
CompatibilityThis documentation covers version v3.2. Check the official docs for the latest API surface.

Installation

pippip install fabric

Methods

Fabric builds on Invoke and Paramiko to run commands on remote hosts from a fabfile.

Key Features

  • Connection objects for remote hosts
  • Task decorators and a fab CLI
  • File transfer and sudo support

Usage Notes

Pin a version and check the official docs for the API surface you depend on before upgrading.

API reference evidence

Fetched from official sources on 2026-11-08T19:16:00+08:00 via WebFetch https://docs.fabfile.org/en/stable/api/connection.html.

FAQ

How do I use sudo?
Call c.sudo(command) which prompts for a password or uses a configured sudo password.
How do I transfer files?
Use c.put(local, remote) and c.get(remote, local) to move files over the connection.
How do I run a task on many hosts?
Use the Group or SerialGroup classes to run the same task across a list of connections.