This repository has been archived by the owner. It is now read-only.
A web interface for running Rust code
Clone or download
alexcrichton Merge pull request #302 from s3bk/master
run playbot in a loop (and disable warnings)
Latest commit 1d0975e Oct 23, 2017

Note: This project is deprecated. To report issues about the playground hosted at, check out the next-gen playpen.


A web interface for running Rust code.

The interface can also be accessed in most Rust-related channels on

To use Playbot in a public channel, address your message to it.

<you> playbot: println!("Hello, World");
-playbot:#rust-offtopic- Hello, World
-playbot:#rust-offtopic- ()
<you> playbot: 1+2+3
-playbot:#rust-offtopic- 6

You can also private message Playbot your code to have it evaluated. In a private message, don't preface the code with playbot's nickname:

/msg playbot println!("Hello, World");

Running your own Rust-Playpen

System Requirements

Currently needs to be run on a system with access to Docker.

Running the web server

First, create the Docker images that playpen will use:

sh docker/

Next, spin up the server.

cargo run --bin playpen

You should now be able to browse and interact.

IRC Bot Setup

You'll need to move playbot.toml.example to playbot.toml and then configure it appropriately.

Setting up the server

First off, start off with a fresh Ubuntu AMI. These should be listed on, and the current one is the Xenial us-west-1 64-bit hvm ebs-ssd server, ami-08490c68.

  • Launch an m3.medium instance
  • Launch into EC2-Classic
  • Protect against accidental termination
  • Make the disk ~100GB
  • Use the existing playground security group

SSH through the bastion, then:

sudo apt-get update
sudo apt-get install python-pip apt-transport-https ca-certificates libssl-dev pkg-config
sudo pip install pygments

curl | sh
git clone

# see
sudo apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo 'deb ubuntu-xenial main' | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get install linux-image-extra-$(uname -r) docker-engine
sudo service docker start
sudo usermod -aG docker ubuntu

Next, configure playbot.toml copied from playbot.toml.example.

Next, open up a screen window (screen -R), and spin up two sessions:

cargo build --release --bin playpen && RUST_LOG=debug ./target/release/playpen 2>&1 | logger -t playpen
cargo build --release --bin playbot && RUST_LOG=debug ./target/release/playbot 2>&1 | logger -t playbot

Add a cron job to update the containers daily, currently:

0 10 * * * cd $HOME/rust-playpen && sh docker/ 2>&1 | logger -t playpen-update