{"id":1832,"library":"flower","title":"Celery Flower","description":"Flower is a real-time web-based monitor and administration tool for Celery distributed task queues. It provides a visual dashboard for task progress and history, worker status, remote control capabilities (e.g., shutdown workers, control pool size), and an HTTP API. It is actively developed and is the recommended monitoring solution for Celery clusters.","status":"active","version":"2.0.1","language":"en","source_language":"en","source_url":"https://github.com/mher/flower","tags":["celery","monitoring","task queue","web ui","admin tool","distributed systems"],"install":[{"cmd":"pip install flower","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Flower is a monitoring tool specifically for Celery.","package":"celery","optional":false},{"reason":"Common message broker for Celery, often used with Flower.","package":"redis","optional":true},{"reason":"Common message broker for Celery, often used with Flower.","package":"rabbitmq","optional":true}],"imports":[{"note":"Flower is primarily designed to be run as a standalone command-line application, not typically imported into other Python applications for its core monitoring functionality.","symbol":"Flower (command-line tool)","correct":"celery --broker=BROKER_URL flower"}],"quickstart":{"code":"import os\nfrom celery import Celery\n\n# 1. Set up a simple Celery app\napp = Celery(\n    'my_app',\n    broker=os.environ.get('CELERY_BROKER_URL', 'redis://localhost:6379/0'),\n    backend=os.environ.get('CELERY_BACKEND_URL', 'redis://localhost:6379/0')\n)\n\n@app.task\ndef add(x, y):\n    return x + y\n\n# To run Celery worker (in a separate terminal):\n# celery -A my_app worker --loglevel=info\n\n# To run Flower (in another separate terminal):\n# celery -A my_app flower --port=5555\n# Or, if not using an app instance directly:\n# celery --broker=redis://localhost:6379/0 flower --port=5555\n\n# Then open http://localhost:5555 in your browser.","lang":"python","description":"This quickstart demonstrates setting up a basic Celery application and then launching Flower to monitor it. Ensure a message broker (like Redis or RabbitMQ) is running and accessible at the specified URL. Flower runs as a separate process and is accessed via a web browser."},"warnings":[{"fix":"Ensure your Flower version is compatible with your Celery version. Consult Flower's release notes and Celery's change log for compatibility. Downgrading Celery or upgrading Flower might be necessary. Using the official Flower Docker image can help isolate dependencies.","message":"Upgrading Celery to version 5.0.0 (and potentially later minor versions in the 5.x series) previously caused `ImportError: cannot import name 'Command' from 'celery.bin.base'` in Flower. This was due to internal API changes within Celery.","severity":"breaking","affected_versions":"Flower versions prior to patches supporting Celery 5.x"},{"fix":"For production or long-term monitoring, configure `--state_save_interval` (in milliseconds) to periodically save state to disk. Be aware that this still stores data in a non-robust format. For true persistence and scalable metrics, integrate Flower with external monitoring systems like Prometheus and Grafana, or consider alternative Celery monitoring solutions that use proper databases.","message":"Flower's default persistence for task history uses Python's `shelve` module, which is primarily in-memory and can lead to complete loss of task history upon Flower restarts or crashes. It also doesn't scale well with a large number of tasks or workers.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always enable authentication when deploying Flower in any environment accessible outside a local development machine. Options include HTTP Basic Authentication (`--basic_auth`), Google OAuth, GitHub OAuth, GitLab OAuth, or running it behind a reverse proxy with its own authentication.","message":"Flower is exposed without any authentication by default, making it vulnerable if deployed publicly without proper security measures. This can expose sensitive task and worker information.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Use the `--broker_api` flag to specify the URL of the RabbitMQ HTTP API, including user credentials. For example: `--broker_api=https://user:password@hostname:443/api/`.","message":"When using RabbitMQ as a broker, especially with cloud providers like CloudAMQP, the 'Broker' tab in Flower might not function correctly or show all details without explicitly providing the RabbitMQ HTTP API URL.","severity":"gotcha","affected_versions":"All versions using RabbitMQ"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}