How to deploy RoR on a vserver?

Hello everyone, I just learned Ruby/RoR but I don’t know how to deploy RoR apps in production environment. What server should I to use, Apache, NGINX?

I’ve worked with PHP before and I used Apache on a vserver with Arch Linux. But now I want to set up a new vserver for RoR Projects.

Can someone give me a few tips because I have a few starting difficulties.

Greeting Tron

Not easy, if you have money to spare I would recommend Heroku.

Otherwise it’s a lot more complicated, I personally use capistrano on an AWS EC2 instance.

See:

Hi Dorian, thank you for your help.

I finished my setup with a vServer

netcup.de
2 vCores
2 GB RAM
40 GB SSD (RAID10)
2,99€

and it works. But what I don’t understand, this

rails server -e production

is doesn’t work, but

rails server -b 0.0.0.0

works.

Know somebody why?

Do I need for the production a production server?

you would need to do rails server -e production -b 0.0.0.0

Here is a good article for setting up a reasonable production environment on a cloud linux virtual server. I use something similar, except my deployment is via git.

PLEASE DON’T RUN rails server ... outside your local development environment

I had already tried that. But Rails threw errors.

Hallo Vlad, thank you for your help. I skimmed the article and it looks promising.

What do you mean by that and why?

  1. Rails is a single-threaded platform, so you need to run multiple processes for performance.
  2. You need some kind of process manager to start/restart the services if they die due to OS issues.

Research the topic on Google.

Hi Vlad, thank you for your post.

I currently have 3 Rails projects running on my vServer. The solution may not be the best, but it works for now with domain.tld:3001 until domain.tld:3003

I’m now putting my focus more on a Rails project.

Thanks to all

Hey Tron,

A easier solution to deploy multiple rails app on the same virtual server is to use Dokku, The installation for Dokku is straight forward and it allows you to have your own person heroku like paas. I’ve been using it for RubyOnRemote on a $6 Vultr VM without any issues. You can also leverage BuildPacks from Heroku if you need to customize your setup.

Using Dokku removes a lot of work for infra management and lets you focus on writing your apps instead of figuring out how to run them.

Do give it a try, all the best!

3 Likes

Hi EKrubyguy. That sounds good. Many Thanks. I’ll try it when I get a chance.

Hello there, Thanks all for such knowledgeable information.