---
title: "Free Ruby Twitter Bot Hosting"
description: "Host a Ruby X (Twitter) bot free on Ruby 3.2 to 4.0 with the x gem. 25% CPU, 256 MB RAM, 512 MB disk and 24/7 uptime. X's own API tiers are separate."
url: "https://sillydev.co.uk/ruby-twitter-bot-hosting"
updated: "2026-11-10"
---

Ruby

# Free Ruby Twitter bot hosting.

The x gem handles OAuth and the X API, and a posting bot fits in one file. What it can do on X depends on X's API tier, not on us.

!

## Our hosting is free. X's API mostly is not.

Everything on this page is about running your bot here, which costs nothing. What your bot is allowed to do on X is set by X's API tiers, and the free one is small and mostly about posting. Reading mentions, timelines or search needs a paid tier bought from X, whatever host you use. Check the current tiers in X's developer portal before you build a bot that replies to people.

Tools that avoid the API by logging in as a normal user and scraping the site break whenever the site changes and get accounts suspended. We will not stop you running one within our acceptable use policy, and we do not recommend it: an account lost that way is lost, and we accept no responsibility for it.

Libraries

## Libraries that run here

x

A Ruby client for the X API that handles the OAuth signing, which is the one part of the API you should not write yourself.

SQLite

The place to record what you have already posted, so a restart does not post it twice.

Deploying

## Getting it running

1. 1
### Upload your project
Drag the folder into the file manager or push it over SFTP. Gems install into a folder inside your server, so there is no need to upload a vendor directory. All four API keys stay out of the folder.
2. 2
### bundle install runs for you
When a Gemfile is present, Bundler installs it before the bot starts and skips the install on later restarts until the Gemfile changes. The x gem is listed in the Gemfile and installed on start.
3. 3
### Point us at your entry file
bot.rb or main.rb. All four keys come from the environment, read with ENV.fetch.

Memory

## What actually fits in 256 MB

A posting bot sits in a modest amount of memory and is idle between posts.

The ways one outgrows the allocation are the same in every language: a headless browser to render images, which will not fit, or a record of every post held in memory rather than in SQLite on your 512 MB of disk.

FAQ

## Questions

**Does the x gem need a paid X plan?**

The gem does not; X does. What a bot is allowed to do is set by X's API tiers, and reading mentions, timelines or search needs a paid one whichever host you use.

**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.

**Where should the secrets live?**

In environment variables set on the server, read with ENV.fetch. A .env file uploaded with your code sits in your file manager like any other file, and Ruby does not read one by itself unless you add a gem such as dotenv for it.

More on Twitter (X) bots

- [Node.js→](https://sillydev.co.uk/nodejs-twitter-bot-hosting)
- [Python→](https://sillydev.co.uk/python-twitter-bot-hosting)
- [Bun→](https://sillydev.co.uk/bun-twitter-bot-hosting)
- [Twitter (X) bots→](https://sillydev.co.uk/twitter-bot-hosting)

Hosting something else?

- [Discord bots→](https://sillydev.co.uk/discord-bot-hosting)
- [Minecraft bots→](https://sillydev.co.uk/minecraft-bot-hosting)
- [Telegram bots→](https://sillydev.co.uk/telegram-bot-hosting)
- [Twitch bots→](https://sillydev.co.uk/twitch-bot-hosting)
- [Reddit bots→](https://sillydev.co.uk/reddit-bot-hosting)
- [Bluesky bots→](https://sillydev.co.uk/bluesky-bot-hosting)
- [WhatsApp bots→](https://sillydev.co.uk/whatsapp-bot-hosting)

Control it from code

- [Bot hosting with an API→](https://sillydev.co.uk/guides/bot-hosting-with-an-api)
- [API docs→](https://sillydev.co.uk/docs/panel)
