Ruby
WhatsApp bots on Ruby.
We do not recommend a Ruby library for this. What changes in Ruby, what 256 MB will carry, and the warning that applies on every runtime.
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 in or push it over SFTP. Gems install into a folder inside your server, and the disk they take is disk you will want for session state.
- 2
Pin everything
List exact gem versions in your Gemfile and keep the Gemfile.lock. Unofficial tools in this space break on minor releases, and a runtime they were not written for is more likely to surface it.
- 3
Point us at your entry file
bot.rb or main.rb. Secrets go in environment variables, and the session directory goes inside your project folder, where it survives a restart.
Memory
What actually fits in 256 MB
The baseline is not the problem. A client that holds one connection open and reacts to messages fits in 256 MB in Ruby as it does anywhere.
The problem, in every language, is anything that starts a browser. If a dependency downloads a browser engine, the deploy fills your disk and the process never starts, and no runtime makes that fit.
Media comes next. An incoming video read wholly into memory costs its full size at once. Write it to disk, work on it there, and delete it afterwards: 512 MB of disk absorbs what 256 MB of memory cannot.
FAQ
Questions
Is Ruby a good idea for a WhatsApp bot?
It is among the riskiest choices. The tools in this space are unofficial, fragile and mostly written for Node.js, and we do not recommend a Ruby one. Whatever you use, check that it is maintained before you build on it.
Will my session survive a restart?
If it is written to a directory inside your project, yes. Files persist across restarts, crashes and redeploys, so a bot that saves its credentials reconnects on its own. One that keeps them in memory asks you to pair again every time.
Does Ruby change the ban risk?
No. The risk comes from automating an account at all, and it is identical in every language.
Is a banned account covered?
No. We run the process; the account and the number are yours, and we accept no responsibility for losing either. The terms of service say the same.
Do gems with native extensions work?
Yes for the common ones. The image has a compiler and the headers for SQLite, PostgreSQL, MariaDB, libxml and OpenSSL, so gems such as nokogiri, pg, mysql2 and sqlite3 build when bundle install runs. The first start after you change your Gemfile takes longer while they compile; later starts skip the install.
More on WhatsApp bots
Hosting something else?
Control it from code