daemonize
Library to enable your code run as a daemon process on Unix-like systems.
What it is and what it does
Daemonize is a minimal library for turning Python scripts into Unix daemon processes. It handles the low-level fork and file descriptor management needed to properly detach a process from the terminal and run it in the background with a PID file. The library accepts a callable, an app name, and a PID file path, then manages the daemonization lifecycle when you call start().
The package is designed for straightforward daemon creation on Unix-like systems (Linux, macOS, BSD). It supports keeping specific file descriptors open—useful for logging—via the keep_fds parameter. However, it has been abandoned since late 2019 and was last tested on Python 2.6, 2.7, 3.3, 3.4, 3.5, so its behavior on modern Python versions and contemporary Unix environments is not guaranteed.
Use it for:
- Convert a long-running Python script into a background service that survives terminal logout and can be managed via PID file.
- Create a simple monitoring or maintenance daemon that performs periodic tasks without blocking the shell.
- Build a lightweight background worker for Unix systems when a full process manager is not available.
- Daemonize a Python application that needs to log to files while running detached from the controlling terminal.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Daemonize provides a Python library for converting regular Python scripts into Unix daemon processes that run in the background with proper process management.
Yes, but with caution. Daemonize is stable and has no known vulnerabilities, making it suitable for legacy systems or simple one-off daemon scripts on older Python versions. However, do not use it for new projects or for production systems where you need active maintenance and security updates. Consider actively maintained process managers instead.
Install
daemonize on PyPI
pip
pip install daemonizeuv
uv add daemonizepoetry
poetry add daemonizeInstalling daemonize
Before you install
Installation is straightforward with no runtime dependencies. However, the package is abandoned—last release was 2018-12-12 and last commit 2019-12-09—so it will not receive bug fixes or security updates.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
from daemonize import Daemonize
from time import sleep
def main():
while True:
sleep(5)
daemon = Daemonize(app="myapp", pid="/tmp/myapp.pid", action=main)
daemon.start()
Unix-like system required (Linux, macOS, BSD); does not work on Windows. Tested on Python 2.6, 2.7, 3.3, 3.4, 3.5; compatibility with newer versions is unverified.
Verify before relying
- Whether the package works reliably on Python versions beyond 3.5, given its abandoned status
- Whether file descriptor handling and signal management remain correct under modern Unix kernels
- Whether the package is compatible with containerized or systemd-managed environments
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,802 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 433,227/month — #6,703 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: daemonize-2.5.0-py2.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
jeedomdaemonProvides a base class and framework for…
permissive · top 15,000 on PyPI
python-daemonImplements PEP 3143 well-behaved Unix daemon…
permissive · top 5,000 on PyPI
pidManages process ID files with stale detection,…
permissive · top 15,000 on PyPI
manholeManhole installs an in-process debugging…
permissive · top 5,000 on PyPI
clamdclamd is a Python interface to the ClamAV…
copyleft · top 5,000 on PyPI
pytest-hot-reloadingA pytest plugin that runs a daemon to watch and…
unclear · top 15,000 on PyPI
portalockerPortalocker provides cross-platform file…
permissive · top 1,000 on PyPI
pmd-pytcpA pure-Python TCP/IP stack (Ethernet through…
copyleft · top 15,000 on PyPI
supervisorSupervisor is a client/server system that…
permissive · top 5,000 on PyPI
cysystemdCython-based wrapper for systemd's libsystemd…
permissive · top 15,000 on PyPI