Tiny, fast & funny HTTP server

Thin is a web server written entirely in Ruby in the simplest way possible. It does as little as possible to serve your Rails application, which makes it one of the fastest Rails server out there.


For the latest stable version:

sudo gem install thin

For the risky but so much cooler alpha version:

sudo gem install thin --source

Or from source:

svn co thin
cd thin
rake install


In your Rails app directory:

thin start



To deploy your Rails application using a cluster of thin servers. You can start it with:

thin_cluster start

To use the Capistrano recipes, add this to your Capfile:

require 'thin'
require 'thin/recipes'

and create a config file using:

thin_cluster config



Thin should never be used facing the internet directly, it should always be hidden behind a proxy server!

Thin is faster because it doesn't do a lot of things that other Ruby web servers do (use threads, validate the body length, be very strict about the request format, etc.) but that a good proxy server do very well (and a lot faster then any Ruby code could possibly do). So it is very important that you setup you proxy server correctly in order to secure Thin from potential attacks.

Nginx comes with everything you need and can be used securely out of the box with thin.

Apache mod_proxy is not secure because it doesn't cache the request before sending it to the backend, which open your server to easy DoS attacks. You need to install mod_accel ( to make mod_proxy behave like Nginx on that side.


Ruby License,


Lots of the code was inspired (or stolen entirely) from Mongrel by Zed Shaw. Mongrel Web Server (Mongrel) is copyrighted free software by Zed A. Shaw <zedshaw at zedshaw dot com> You can redistribute it and/or modify it under either the terms of the GPL.

transat/parser.rb was taken from Piston source code. Copyright © 2006 Francois Beausoleil <>

Thin is copyright Marc-Andre Cournoyer <>

Please report any bug at