Prepare the project
- Pin dependencies in
requirements.txt. - Read tokens with
os.environ, never hard-code them. - Log to stdout so the host shows logs.
- Add a Dockerfile (our templates include one).
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
USER nobody
CMD ["python", "-m", "bot.main"]
Deploy
Railway: connect the GitHub repository, add the variables, deploy. Tutorial: deploy a bot on Railway.
Vultr: create a venv on the server and a systemd unit. Tutorial: bot on a Vultr VPS with systemd.
Templates: aiogram · discord.py · FastAPI WhatsApp
Frequently asked questions
Which Python version?
Our templates require Python 3.10 or newer; use a currently supported release.
Do I need Docker?
No, but it makes the build reproducible on any host.
How do I keep it running after crashes?
Use the platform restart policy or systemd Restart=always.