Deploy a Python bot as a systemd service
deploy_python_botClone a git repository, create a virtual environment, install dependencies from requirements.txt, write a systemd unit with auto-restart, and start the service for a Python bot.
Instructions
Clones (or updates) a git repo, creates a venv, installs requirements.txt, writes a systemd unit with auto-restart, and starts it. Designed for long-running Python processes like aiogram Telegram bots. Does NOT set up a reverse proxy — use setup_nginx_ssl separately if the bot needs to be reachable over HTTP(S).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | Server IP address or hostname, e.g. 168.119.45.12 | |
| port | No | SSH port, defaults to 22 | |
| branch | No | Git branch to checkout, defaults to the repo's default branch | |
| appName | Yes | Short name for this app, used as the directory and service name, e.g. 'solpath-bot' | |
| repoUrl | Yes | Git repo URL to clone, e.g. https://github.com/you/your-bot.git | |
| username | Yes | SSH username, e.g. root or deploy | |
| entryPoint | Yes | Path to the entry script relative to the repo root, e.g. 'main.py' | |
| passphrase | No | Passphrase for the private key, if it has one | |
| envFileContent | No | Contents to write as .env in the app directory (API keys, etc.) | |
| privateKeyPath | Yes | Path to the private key on THIS machine, e.g. "~/.ssh/id_ed25519" |