Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for some ideas on how to start up my "Thin" Rails server automatically, whenever the machine where it resides reboots.

The problem is that when the machine reboots, "Thin" needs to be started up manually, which causes issues with the Rails sites being down until someone starts up "Thin" by hand.

/var/www/app_directory# thin start --ssl -e production

Ruby: 1.9.2
Rails: v3.2.1
Thin: v1.5.0
Machine: Debian 6 "Squeeze"

I know that apache runs as it's own user on the box. Not sure if that same approach makes sense with my particular problem.


share|improve this question

I used the instructions here:

to create a configuration file and start thin as a normal service at server boot. To get started, one would run:

thin install

It should set up a start up file in hopefully the proper directory, and tell you where it is. For me, in CentOS/Fedora I had to move the thin file from /etc/rc.d to /etc/rc.d/init.d

You then add it to chkconfig, or similar facility in your system, and turn it on for the right run levels (3,4,5). I did:

chkconfig --add thin
chkconfig --level 345 thin on
chkconfig --level 2 thin off

And you can start or restart thin with:

service thin start
service thin restart
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.