Open-source deployments for Python projects

Automate Python deployments without reinventing your scripts.

Pystrano is an open-source CLI for running repeatable deployment tasks from plain YAML playbooks. Use it as-is, adapt it for your stack, and share what you learn.

  • YAML configs live in version control
  • Roll back by promoting an earlier release
  • Supports staging, production, or custom targets
pystrano deploy production api
$ pystrano deploy production api
✓ Connecting to production api
✓ Pulling branch main
✓ Installing system packages
✓ Syncing release files
✓ Applying migrations & static assets
✓ Restarting gunicorn.service
✅ Deployment completed in 42s
15+
Community recipes

Examples shared by maintainers and users.

5 min
Initial setup

Bootstrap an environment with "pystrano setup".

Why Pystrano?

A small tool that does one job well.

Pystrano focuses on predictable automation: keep deployments scripted, reviewable, and easy to hand over to the next person.

Declarative configs

Describe environments once in YAML and reuse them across staging, production, or any custom server.

Built-in safeguards

Ship with managed known hosts, secrets scaffolding, and SSH practices that keep surprises low.

Iterate locally

Test deployments in isolated environments and keep release history ready for quick rollbacks.

Workflow

Use the CLI in three repeatable steps.

Keep your release process explicit so anyone on the team can run it.

1
Define shared defaults

Start with a common block for shared settings and override only what differs per environment.

2
Bootstrap environments

Provision packages, sync secrets, and register services with a single pystrano setup run.

3
Deploy when ready

Ship your release, run migrations, and roll back by selecting a previous build when needed.

Get Started

Set up, describe, deploy.

Install Pystrano from PyPI, inspect the YAML examples, and adapt them to match your project's checklist.

Install the CLI
pip install pystrano
Describe your stack
One YAML file, limitless environments.
Deploy when ready
pystrano deploy staging api
Quick configuration sample
common:
  source_code_url: git@gitlab.example.com:example/example-backend.git
  project_root: example-backend
  project_user: example-user
  venv_dir: venv
  keep_releases: 5
  system_packages: |
    libpq-dev
    python3-dev
    memcached
    libjpeg62-dev
    zlib1g-dev
  env_file: ./.env.example
  ssh_known_hosts: gitlab.example.com;other.host.com
  service_file: ./deploy/api/production/gunicorn.service
  secrets: ./secrets/secret-key.json
  branch: main
servers:
  - host: 192.168.0.1
    run_migrations: true
    collect_static_files: true
  - host: 192.168.0.2
# Setup once per environment
pystrano setup staging api

# Deploy whenever you ship
pystrano deploy staging api

Try Pystrano and share feedback.

Pystrano is MIT-licensed. Use it, fork it, and let us know what would help you ship with more confidence.