Just a learner
Just a learner

Reputation: 28632

How to deploy a rails project on a Ubuntu server?

I've developed my Rails project locally and want to deploy it on my Ubuntu VPS. Now I've installed the gems on the VPS and copied my Rails App code to it. I can execute rails s --binding=0.0.0.0 in a putty session to the VPS and the website can be access from the Internet. The problem is when I close putty, the website is down. How to start my Rails App in a way that it still alive even if I closed putty?

Upvotes: 1

Views: 154

Answers (1)

Cassio Cabral
Cassio Cabral

Reputation: 2692

Using rails s is not the way to go. It will use Webrick(or a different one if you choose) to handle the requests and it can be quite slow.

You should setup a production stack for serving your website.

Here is one of the best tutorials I've seen about how to deploy a Rails app to a production server(VPS).

In short you gonna need install RVM or Rbenv, Ruby, some libs, Database, Nginx and Passenger. You have alternatives too. But this is the basic.

I recommend using Capistrano for deploy. You can choose another deployment tool also, or none.

rails s it is best for development only.

Upvotes: 2

Related Questions