Python
WhatsApp bots on Python.
What the runtime costs you before your code starts, how session state survives a restart, and the warning that applies whichever language you pick.
We will host it. We do not recommend it.
Automating a personal WhatsApp account is not something WhatsApp supports. The tools that do it work by pretending to be the official app, they break whenever the protocol changes, and using one can get your number banned — sometimes permanently, sometimes without warning, and always without an appeal you can rely on.
That risk is yours, not ours. We accept no responsibility for a number, an account, or a set of contacts lost while running a bot hosted here, and nothing on this page should be read as advice that it is safe to do. If losing the number would be a problem, do not use one you care about.
If your use is commercial, the officially supported business API exists precisely so you do not have to take that risk, and a bot that receives its messages through official channels has no ban exposure of this kind at all.
Deploying
Getting it running
- 1
Upload your project
Drag the folder into the file manager or push it over SFTP. No virtual environment is needed — your server is already isolated from everyone else on the machine.
- 2
requirements.txt does the rest
Installed on deploy, before your bot starts. Pin every version. Tooling in this space moves fast and breaks without ceremony, and an unpinned upgrade at three in the morning is how a working bot stops being one.
- 3
Point us at your entry file
Usually main.py or bot.py. Read anything sensitive from os.environ, and keep your session files inside your project directory so they survive a restart.
Memory
What actually fits in 256 MB
Less headroom than Node gives you, and the difference is front-loaded. The interpreter plus your imports costs something before a single message arrives, so a Python bot starts further up the 256 MB than an equivalent Node one does. For a socket client that is still comfortable; it is simply a smaller margin.
Native dependencies are where that margin disappears. A pure-Python package is cheap; one that pulls a compiled cryptography or media stack behind it is not, and something that expects a browser engine will not install inside your disk quota at all, let alone run inside your memory.
For media, do the same thing you would on Node and for the same reason: stream to disk rather than reading a file into memory. Python makes it tempting to load the whole thing because the code is shorter, and a single video is enough to end the process.
Async is worth a thought here. With 25% of a core, a blocking call in a message handler stalls everything queued behind it. If your bot does anything more than reply with text, keep the I/O non-blocking.
FAQ
Questions
Is Python a good choice for a WhatsApp bot?
It is a workable one. The tooling for this on Python is thinner and less actively maintained than on Node, which matters more here than elsewhere because these tools break when the protocol changes. If you have no existing reason to use Python, Node will cost you fewer evenings.
Do I need a virtual environment?
No. Your server is isolated already, so there is nothing to keep separate from. Everything in your requirements.txt is installed for you on deploy.
How do I avoid re-pairing on every restart?
Persist your session state to files inside your project directory. Disk survives restarts and crashes; memory does not. A bot that stores its credentials properly comes back on its own after a restart with no involvement from you.
Will the interpreter overhead cause problems?
On its own, no — a socket client fits fine. It becomes a problem when it is stacked with heavy native dependencies and buffered media on top. Import only what you use and stream anything large to disk, and 256 MB is enough.
Am I covered if the account is banned?
No. We host the process; the account and the number are yours, and we accept no responsibility for losing either. This is stated in the terms of service as well as on this page.
More on WhatsApp bots
Hosting something else?