Posted On August 27, 2015 By In Developers With 8926 Views

Hosting a Steam Bot on OpenShift Online

So you just finished your first Steam trade bot.  Or maybe you’ve done this a while and just read the updated tutorial using the simplified steam-user library.  Either way, if you don’t have a dedicated server, odds are you don’t have a place to host the bot long-term.  Sure, you could run it on your desktop and let it go offline when you reboot, but that’s certainly not ideal.  Or you could get a VPS for $5/mo, but you probably don’t want to maintain your own server and its security.  If you do, congratulations; you’re a hobbyist!  If you don’t, find a free PaaS.

What is a PaaS?

PaaS stands for Platform as a Service.  In a general sense, it’s a thing to run your thing on.  That’s really all you need to know.  But if you’re interested in how it works, read on.

What a PaaS really means is that you run your application in the cloud managed by someone else.  Usually your app will live in a container like Docker.  Think back to the old days when you would spin up an entire virtual machine to get a lightweight version of a server.  Lots of VMs can be put on a single physical server, but each VM has the overhead of the entire operating system.  At the time, this was better than everyone getting their own bare-metal server.  But now we’ve evolved beyond that silliness.  Container-based virtualization solutions, such as Docker, remove all the OS overhead.  You can run just your application in a container and it barely takes up any more resources than the application itself.  It also means that professional DevOps can manage thousands (or hundreds of thousands) of applications on behalf of developers.  While they don’t touch your actual application, they do take care of system security, load-balancing, network issues, and server failures.

From our perspective, this means we can deploy our web application and only worry about the application itself.  All other forms of management are gone.  And since PaaS solutions are on the cloud, the ability to naturally scale your application based off the resources it’s trying to use is pretty simple.  OpenShift apps allow this with just a click of a button.  We won’t need to do that with a trade bot, but imagine you run an online store.  At 3am a week after launch, odds are you’ll have no traffic.  Scale your app down to use almost no resources and you can usually get away with not paying a dime for it running.  Fast-forward to a Cyber Monday sale at noon and you might temporarily need 20x your regular resources.  No problem–more instances of your webserver will spin up and take turns serving user requests.  You’ll be charged by the hour for these extra resources, which will be much cheaper than having to rent a dedicated box that can handle this much traffic all year round.  Yay cloud!

Getting Started with OpenShift Online

First let’s talk about pricing.  There are multiple tiers of accounts, the first is the Free tier.  Like its name implies, it’s 100% free.  No credit card needed or anything like that.  You’re given three small “gears” (containers with a small amount of allocated resources).  The downside is that the URL of your application will need accessed once every 24 hours or your application will go into an idle mode.  This will make your Steam bot sign off.  You can set up a scheduled task or cronjob to hit it a couple of times per day if you want, or you can remove this restriction by upgrading to the Bronze tier by supplying a credit card.

You can use the Bronze tier like the free one–pricing is exactly the same (3 free small gears).  The difference is that you can run larger gears and have more than 3 running at a time.  If you do run more than 3, you’ll be charged 2 cents an hour per small gear.  Remember though, you can run many Steam trade bots from a single application.  I’ve had a Bronze account for over a year now and I’ve paid exactly $0.00 for it.  For more information, view their pricing page to see if this is something you want to do:  There’s no good reason not to upgrade to Bronze if you have a credit card.

Create an Account

Super easy:  If you want to upgrade to the Bronze plan, you can do that after you sign up.  Just click on your email address and go to “My Account” or click here:

When you’re signed in, you’ll be presented with a list of your applications, which we don’t have yet.

Create an Application

Click the large “Create your first application now” link on your app page.  You’ll land on a page with a bunch of pre-configured official packages from Red Hat.


03/2016 Update: IO.JS is a dead project since it has been merged into Node.JS v4.0.  Selecting “Node.JS (Latest)” on the cartridge selection page is how you would do it now.  There is no need to use a custom cartridge.  This section remains for historical purposes.
At the time of writing this, the only official Node.js cartridge is v0.10.  We need something newer, so we’ll use a custom io.js cartridge instead.  Scroll down to the bottom of the page and find the “Code Anything” box.  Paste this link to the manifest file into the box and click Next:

OpenShift - App Create

I’m going to use the v2.0 tutorial as my project.  First we give it a name, which will appear in the domain as well.  Since the project exists on github, I can just paste the https version of the link in and it will grab the entire repo for us.  If you’re on bronze, be sure to select a small gear otherwise you’ll be charged for it.  The cartridge field should have the manifest file we used earlier.  This project uses a config file with credentials, so we can’t scale it otherwise the second gear would kick the first one off of Steam, then the first would kick the second off… infinitely.  If we had a list of bot usernames/passwords in a database and kept track of which ones were in use, we could potentially scale the bots as needed, but that’s well beyond this scope.

Hit create and wait a minute for it to build your iojs cartridge and clone the bot repo.  Each OpenShift app creates its own git repo from the settings your provided.   When it’s done installing a screen will appear with information showing you how to clone this new repo so you can work on it locally.

Configure the Bot

Since we’ll need to login once manually to enter a Steam Guard code, we may as well just edit it there.  To do this, we need to SSH in.  First add your public SSH key to your OpenShift account under the Settings tab.  If you’ve never used SSH before, here’s a good Windows guide (ignore the bits about importing to Digital Ocean):

OpenShift - PuTTY Connect

Once you’re connected, navigate to the bot’s directory and setup your config file. I use vim to edit files, but if you’ve never used it before you might want to use nano instead. Or you can clone your openshift repo, edit locally, git commit, and push back into openshift.

Now install our dependencies listed in the package.json file.

Setup for OpenShift

Update: As of version 1.8.0 of node-steam-user, OpenShift is supported without any additional configuration.  See more release notes here:

Once you add your username and password, we also need to make a small change to the bot itself. The default settings for node-steam-user try to save files somewhere that containers generally don’t allow. Change the line that initializes SteamUser from this:

To this:

This ensures that our Steam Guard codes and other related files are saved persistently.

Run Once for Steam Guard

In the same way that you run any node application, start the bot.  Remember, we’re using iojs instead of node:

Enter the code and you’re done!  The sentry file should be saved and from here on out you wont need to SSH in again.

Further Reading

If git is confusing to you, check out this beginner’s guide to git: or the official community book available online:

OpenShift Online’s docs are available here:

Tags : , , , ,


Jake is a web developer who loves data and automation. He went to the University of Alaska Fairbanks and studied Computer Science and Information Technology. Most of his work is done in PHP, MySQL, and Javascript.

6 Responses

  1. Pasting “” doesn’t give me the source code or anything..

  2. cp config.example.js config.js gives me “cp: cannot stat `config.example.js’: No such file or directory”

  3. Is the bot supposed to run 24/7 after doing the iojs command? Because once I close putty, the bot goes offline.

  4. The cartridge manifest at ‘’ could not be downloaded: The cartridge manifest at ‘’ must be smaller than 20480 bytes.

    • Iojs has been merged into NodeJS since version 4.0. As such, iojs is no longer needed. The “NodeJS (Latest)” cartridge provided by Red Hat should work even better, and is easier to setup since it’s just a single click.

Leave a Reply