Installation#
This document provides instructions for installing OpenFL; either in a Python virtual environment or as a docker container.
Requirements#
For a list of Python supported versions see Python version support policy. Docker images are only supported on linux/x86_64 platforms.
Using pip#
We recommend using a Python virtual environment. Refer to the venv installation guide for details.
From PyPI (latest stable release):
pip install openfl
For development (editable build):
git clone https://github.com/securefederatedai/openfl.git && cd openfl pip install -e .
Nightly (from the tip of develop branch):
pip install git+https://github.com/securefederatedai/openfl.git@develop
Verify installation using the fx --help command.
OpenFL - Open Federated Learning
BASH COMPLETE ACTIVATION
Run in terminal:
_FX_COMPLETE=bash_source fx > ~/.fx-autocomplete.sh
source ~/.fx-autocomplete.sh
If ~/.fx-autocomplete.sh already exists:
source ~/.fx-autocomplete.sh
CORRECT USAGE
fx [options] [command] [subcommand] [args]
GLOBAL OPTIONS
-l, --log-level TEXT Logging verbosity level.
--no-warnings Disable third-party warnings.
--help Show this message and exit.
AVAILABLE COMMANDS
...
Using docker#
This method can be used to run federated learning experiments in an isolated environment. Install and verify installation of Docker engine on all nodes in the federation. Refer to the Docker installation guide for details.
Pull the latest image:
docker pull ghcr.io/securefederatedai/openfl:latest
Note
This command works only from
linux/x86_64platforms since the image is built for this platform.Build from source:
git clone https://github.com/securefederatedai/openfl.git && cd openfl git checkout develop
docker build -t openfl -f openfl-docker/Dockerfile.base .
Note
This command copies current context (i.e. OpenFL root directory) to the base image. Ensure that the
.dockerignorefile is configured to exclude unnecessary files and directories (like secrets or local virtual environments).